使用批处理和键盘输入运行程序

时间:2017-04-18 15:07:10

标签: windows batch-file

我正在处理批处理文件,该文件将接受键盘输入,然后根据我的选择启动不同的东西。我有以下内容我没有得到runnin:cd并且当他们独自时开始工作但不是去参与。

set /p %environment%=Goede dag Jeroen! Wilt u beginnen met FME(f), 
AutoCAD(a), beide(b) of alleen opstart(g)? f/a/b/g :

IF /i "%environment%" == "f" GOTO work
IF /i "%environment%" == "a" GOTO cadprog
IF /i "%environment%" == "b" GOTO same
IF /i "%environment%" == "g" GOTO geen
ECHO "Ongeldige keuze. Kies alstublief opnieuw"
GOTO end

:work 
cd "C:\Program Files (x86)\FME"
start fmeworkbench.exe

cd "C:\Program Files (x86)\Google\Chrome\Application"
start chrome.exe

cd "C:\Program Files (x86)\Mozilla Firefox"
start firefox.exe

%SystemRoot%\explorer.exe W:\DataService\Colo

%SystemRoot%\explorer.exe W:\DataService\Colo
goto end

:cadprog
cd "C:\Program Files\Autodesk\AutoCAD Map 3D 2012"
start acad.exe

cd "C:\Program Files (x86)\Google\Chrome\Application"
start chrome.exe

cd "C:\Program Files (x86)\Mozilla Firefox"
start firefox.exe

%SystemRoot%\explorer.exe W:\DataService\Colo

%SystemRoot%\explorer.exe W:\DataService\Colo
goto end

:same
cd "C:\Program Files\Autodesk\AutoCAD Map 3D 2012"
start acad.exe

cd "C:\Program Files (x86)\FME"
start fmeworkbench.exe

cd "C:\Program Files (x86)\Google\Chrome\Application"
start chrome.exe

cd "C:\Program Files (x86)\Mozilla Firefox"
start firefox.exe

%SystemRoot%\explorer.exe W:\DataService\Colo

%SystemRoot%\explorer.exe W:\DataService\Colo
goto end

:geen
cd "C:\Program Files (x86)\Google\Chrome\Application"
start chrome.exe

cd "C:\Program Files (x86)\Mozilla Firefox"
start firefox.exe

%SystemRoot%\explorer.exe W:\DataService\Colo

%SystemRoot%\explorer.exe W:\DataService\Colo

:end
PAUSE

1 个答案:

答案 0 :(得分:0)

你必须修复第一行:

set /p environment=Goede dag Jeroen! Wilt u beginnen met FME(f), AutoCAD(a), beide(b) of alleen opstart(g)? f/a/b/g :