2017-06-13 2 views
0

Hilfe, wenn ich mein Programm öffne es schließt und ich weiß nicht, was falsch ist ?!mein Programm schließt und ich weiß nicht warum

@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

nicht Sie einen Doppelklick auf die Batch-Datei zu öffnen, eine Eingabeaufforderung öffnet stattdessen Manöver auf den Pfad der Batchdatei mit 'cd/D' und Typ der Name der Batch-Datei, um sie auszuführen; nachdem Sie die Zeile '@echo off' entfernt haben, sehen Sie alle Ausgaben und Fehlermeldungen ... – aschipfl

Antwort

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 
... 
Verwandte Themen