小编ser*_*dar的帖子

在 rmdir 或 rd 命令中使用通配符

假设D:驱动器中有一些文件夹:

D:\Air
D:\Abonden
D:\All
D:\Whatever
Run Code Online (Sandbox Code Playgroud)

我想删除所有以“A”开头的文件夹(包括所有子文件夹和文件)。我试过这个命令:

rmdir D:\A* /s /q
Run Code Online (Sandbox Code Playgroud)

不过我收到一个错误:(

文件名、目录名或卷标语法不正确。

del命令适用于*,但我也需要删除文件夹。
有没有办法通过rmdir命令来实现?

windows batch command-line

48
推荐指数
4
解决办法
9万
查看次数

在远程计算机上运行 vbs 代码时没有错误

我希望这个 vbs 代码能在远程机器上执行 oShell.run 方法。情况似乎并非如此,但此脚本执行时没有显示错误。

on error resume next

dim oShell, strComputer, intProcessID

strComputer = InputBox("IP or Host Name:", "DELETER - serdaruzun@outlook.com")

set oShell = WScript.CreateObject("Wscript.shell") & strComputer

oShell.run "cmd.exe /C rd \\%PC%\Users\1*.* /s /q", null, null, intProcessID
oShell.run "cmd.exe /C rd \\%PC%\Users\2*.* /s /q", null, null, intProcessID
oShell.run "cmd.exe /C rd \\%PC%\Users\3*.* /s /q", null, null, intProcessID
set oShell = nothing
Run Code Online (Sandbox Code Playgroud)

在远程计算机上执行这些命令的正确方法是什么?

windows vbscript cmd.exe

-6
推荐指数
1
解决办法
835
查看次数

标签 统计

windows ×2

batch ×1

cmd.exe ×1

command-line ×1

vbscript ×1