我有一個腳本將2個文件保存在備份文件夾中。如果複製命令成功,我想獲得一個消息框。關閉後無法從.bat文件繼續執行腳本msgbox
@echo off
Echo msgbox"Saving test1 to \backup directory." + vbNewLine + "Successfull!",0,"Backup file..">test1.vbs
Echo msgbox"Saving test2 to \backup directory." + vbNewLine + "Successfull!",0,"Backup file..">test2.vbs
copy test1.txt backup\test1.txt
if %ERRORLEVEL% == 0 (
start test1.vbs
goto test2
)else (
echo ## Errorausgabe: %ERRORLEVEL%
echo.
)
:test2
copy test2.txt backup\test2.txt
if %ERRORLEVEL% == 0(
start test2.vbs
goto commonexit
)else(
echo ## Errorausgabe: %ERRORLEVEL%
)
:commonexit
pause
它的工作,直到我從test1消息框。但是當我點擊提交時,test2不會啓動。這裏有什麼問題?
它複製兩個,但不顯示msgbox! – nolags
@nolags請再次檢查我編輯我的答案,我測試它的MsgBox顯示爲我! – Hackoo
它在vbscript中打印兼容性問題..他正在等待命令完成test2.vbs – nolags