好的,我想做的是检查
我的问题是我不知道错误是什么,因为它立即关闭。
if [%1] NEQ [] (
for /f %%i IN ("%1") do (
set OPENWNAME=%%~ni
set OPENWEXT=%%~xi
)
set OPENW=%OPENWNAME%%OPENWEXT%
set FILENAME="paths.ini"
if NOT %OPENW%=%FILENAME% (
echo The file you selected is not paths.ini
pause
exit
) else (
echo You selected paths.ini
pause
goto Next
)
)
我知道发布代码并期望人们为你修复它是愚蠢的但如果我可以指定我的错误我会谷歌它:D
我打赌我犯了一个明显的错误,但我看不出来。提前谢谢。答案 0 :(得分:0)
为什么不呢:
if "%~n1%~x1" EQU "paths.ini" (
echo You selected paths.ini
pause
goto Next
) else (
echo The file you selected is not paths.ini
pause
exit
)
完成!