我想列出目录下的所有exe文件然后让用户输入序号执行他,该怎么做?- for /f "delims=" %%i in ('dir /a/b *.exe ^| findstr /n /i .*') do (
- SET topic[!n!]=%%i
- CALL echo %%topic[!n!]%%
- )
- :end
-
- SET /p %a%=Select Num:
-
- :SymLoop
- if defined topic[%x%] (
- set /a "x+=1"
- GOTO :SymLoop
- )
-
- SET /p %a%=Select Num:
-
- SET fileName= !topic[a]!
- @echo on
-
- xelatex.exe -synctex=1 -interaction=nonstopmode %fileName%
- xelatex.exe -synctex=1 -interaction=nonstopmode %fileName%
- xelatex.exe -synctex=1 -interaction=nonstopmode %fileName%
复制代码
|