我试图让cmd.exe检查我的文件是否存在,我写道:
if system32/format.dll exists
goto start
else
start startuperror.vbs
然后我保存了它并且它给了我一个错误并且同时它关闭了,我可以在它关闭之前在命令提示符窗口中看到错误。 (我通过答案找到了)
答案 0 :(得分:1)
试
if exist c:\system32\format.dll goto start
start startuperror.vbs
goto :end
:start
rem Whatever you want to do here if the dll exists.
:end
echo Quitting. Press a key
pause
但是下一次。首先开始cmd
。在命令提示符下,您可以导航到正确的目录并启动脚本。这将允许您查看实际输出。此外,如果添加/?
,大多数命令都有一些内置文档。例如if /?
。
答案 1 :(得分:1)
这是另一种选择:
if not exist "c:\windows\system32\format.dll" (
start "" startuperror.vbs
) else (
echo The dll exists.
)
pause