:prompt
set /p "asm_file_path=Enter full path name of asm file:"
pause
rem Validate the file path
:validate
if not exist %asm_file_path% (
echo Error! %asm_file_path% does not exist. Please enter valid file
echo.
goto prompt
) else (
echo File found. Continuing...
echo.
)
我只是想获取用户输入并将其存储到var asm_file_path中。但由于某种原因,该程序进入无限循环的错误!因为var等于“”。我已经尝试了How to get two or more commands together into a batch file和How to read input from console in a batch file?甚至dos指南,但我只是看不出这里有什么问题。
修改 该程序不允许我输入任何内容。我使用的是Windows 98。
答案 0 :(得分:1)
您确定使用的是Windows 98 吗?我觉得the /P
and /A
switches have been added to the SET
command since Windows NT/2000。