我试图让这个程序读取一个参数,然后再将参数转换为read,如果有的话。如果没有任何要退出的东西,并且最初没有退出的参数并将errorlevel更改为1.我会继续尝试运行它并接收"(此时出乎意料的是#34;我相信我有适当的格式。谁能给我一些线索?
if %1 == "" (
echo Usage: %0 varname1 ...
echo Determines if variable name is defined
exit /b 1
)
:again
rem - if %1 is not blank, we loop
if not %1 == "" (
if not defined %1 echo %1 is NOT defined environment variable.
if defined %1 echo %1 is defined environment variable.
rem - shift the arguments and examine %1 again
shift
goto again
)