2017-06-13 106 views
0

幫助,當我打開我的程序它關閉,我不知道什麼是錯的?!我的程序關閉,我不知道爲什麼

@echo off 
 
title test 
 
echo wat is het wachtwoord? 
 
SET /p hoi =: 
 
if "%hoi%" == "hallo" 
 
goto idk 
 

 
:idk 
 
xcopy /s "E:\Windows.old\Program Files\WindowsApps\Microsoft.3DBuilder_11.1.9.0_x64__8wekyb3d8bbwe\test" "D:\" 
 
pause() 
 

 
:exit 
 
EXIT

+0

不要雙擊使用'CD/D'和類型打開批處理文件,打開命令提示符窗口,而不是,機動到批處理文件的路徑要執行它的批處理文件的名稱;在刪除'@echo off'這一行之後,你會看到所有的輸出和錯誤信息...... – aschipfl

回答

1
... 
if "%hoi%" == "hallo" goto idk 

:: Note the `goto` must be on the same line as the `if` 
:: Note also that if the above test fails, batch will simply continue 
:: executing commands, so the next command to be executed 
:: will be the "xcopy" following 

:idk 
xcopy /s "E:\Windows.old\Program Files\WindowsApps\Microsoft.3DBuilder_11.1.9.0_x64__8wekyb3d8bbwe\test" "D:\" 
:: 
:: PAUSE takes no parameters. The `()` will cause the `pause` not 
:: to be recognised - `cmd` will attempt to execute a command "pause()" 
:: and fail. 
pause 
... 
相關問題