私はここでばかげているかもしれませんが、私が持っているこのバッチコードの奇妙な動作を理解することはできません.
だから私は次のコードを持っています:
@echo off
set exitval=0
:selectdir
echo Type the name of the folder where the software is installed (or drag and
echo drop the folder here):
set /p sdir=
set sdir=%sdir:"=%
echo.
if not exist "%sdir%\Lib\Plugins" (
echo The plugins directory does not exist! Try again ^(y/N^)^?
set /p c=
if "%c%" == "y" goto selectdir
goto exitscript
)
:exitscript
pause
exit /b %exitval%
控えめに言っても、これは一貫した動作を示しません。
D:\Development>test.cmd
Type the name of the folder where the software is installed (or drag and
drop the folder here):
C:\xyz
The plugins directory does not exist! Try again (y/N)?
y
Press any key to continue . . .
D:\Development>test.cmd
Type the name of the folder where the software is installed (or drag and
drop the folder here):
C:\xyz
The plugins directory does not exist! Try again (y/N)?
n
Type the name of the folder where the software is installed (or drag and
drop the folder here):
C:\xyz
The plugins directory does not exist! Try again (y/N)?
n
Press any key to continue . . .
上記のコードの問題は何ですか? 一貫して機能しないのはなぜですか?