我想创建一个批处理文件,让我选择打开各种可执行文件。例如,
What do you want to open?
1. Application1.exe
2. Application2.exe
3. Application3.exe
输入一个数字将打开所需的可执行文件,该文件不在批处理文件本身的同一目录中。所以它基本上是一个发射器。
答案 0 :(得分:0)
@echo off
:input
echo What do you want to open?
echo 1. Application1.exe
echo 2. Application2.exe
echo 3. Application3.exe
set /p "app=: "
if "%app%"=="1" goto :start Application1.exe
if "%app%"=="2" goto :start Application2.exe
if "%app%"=="3" goto :start Application3.exe
echo Invalid option!
goto :input
:start
start "" "%~1"
exit