EDIT:問題を見つけました。私の入力変数と 'If'変数が異なっていたので、変更した後にその変数の1つを変更するのを忘れました。"goto"エラーのある "If"文
私のコードに問題があります。
エラー。
"goto installupdate" was unexpected at this time
それはすべて
if %updatech%==Y goto iu
if %updatech%==y goto iu
if %updatech%==N goto noupdate
if %updatech%==n goto noupdate
まで動作し、私は私が間違ってやっているかわからないんだけど。誰でも私のコードで何がうまくいかないのか考えていますか?
コード:次のコード行で
:updatecheck
bitsadmin.exe /transfer "updatecheck" "http://serverse.playat.ch/overtone/update.txt" "%temp%\overtoneupdate.txt"
set /p versioncompare=<"%temp%\overtoneupdate.txt"
del "%temp%\overtoneupdate.txt"
cls
if %currentbuild% == %versioncompare% goto noupdate
set /p updateyn=New version found! Would you like to update? [Y/N]:
if %updatech%==Y goto iu
if %updatech%==y goto iu
if %updatech%==N goto noupdate
if %updatech%==n goto noupdate
goto updatecheck
:iu
bitsadmin.exe /transfer "update" "http://serverse.playat.ch/overtone/%versioncompare%update.bat" "%cd%\update.bat"
echo %versioncompare%>upvers.txt
update.bat
exit
:noupdate
cls
goto install
私はすでにあなたがその音から見つけた解決策を投稿しましたが、プロンプトが表示されたら誰かがEnterキーを押しただけでコードが破損するため、余分なメモを追加しましたそれらの新しいバージョンについて。 –
'if /?'あなたのコードを短縮するために '/ i'パラメータを見てください。また、 'choice'コマンドに興味があるかもしれません。 – Stephan