私が書いているバッチスクリプトにこの小さな問題があります。Q:EXIST/IFがバッチスクリプトに存在しない場合
:Delete_File
cls
title Delete File
echo Welcome to the Utility Delete File!
echo Type the name of the file you want to delete:
echo.
set /p var=
echo.
echo I'm checking the existance of the file...
ping 192.0.2.2 -n 1 -w 2000>nul
if EXIST %var% del %var%
if NOT EXIST %var% echo The file doesn't exist. Check for errors and try again.
ping 192.0.2.2 -n 1 -w 1500>nul
set /p answer=1 - Go to Menu _ 2 - Go to Exit
if %answer%==1 goto Menu
if %answer%==9 goto Exit
ので、問題は、ファイルが設立されたときに、それが削除されるということですが、それは12日、文字列中にメッセージが表示されます。 私は質問の不正な構文のために、本当に申し訳ありませんが、私は新たなんだ
echo The file was successfully deleted!
echo Redirecting you to the Menu...
ping 192.0.2.2 -n 1 -w 2000>nul
goto Menu
...メニューにリダイレクトしています!ファイルが正常に削除されたメッセージ」を示すことが必要である。 私はすべての応答をありがとうを取得 フェデリコ
12行目を意味します。以下の答えはあなたの問題を解決しますが、使用していたロジックについて考えてみてください。ラインをフリップフロップします。 – Squashman