2017-06-13 75 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 
... 
相关问题