无法将变量(路径)从vbs中的用户输入传递到批处理命令以删除Thumbs.db

时间:2016-04-22 13:02:30

标签: batch-file

这是我的代码(delete_thumbs.vbs):

Dim str
str = InputBox("Enter the path from where you want to delete thumbs")
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd /K CD /d & str"

我愿意通过提示他们使用InputBox输入路径来获取文件夹路径的用户输入,然后执行命令删除该文件夹中的所有Thumbs.db。

删除Thumbs.db的命令

del /s /q /f /a:h Thumbs.db

我面临的问题是,当我运行" delete_thumbs.vbs"它会提示用户输入以输入文件夹的路径,但在输入路径后,它在CMD中未被检测到,它只是提示:

The system can not find the path specified

C:/Users/user/Desktop

请指导我。我哪里出错

0 个答案:

没有答案