I do a lot of work with Citrix servers and one of the things we use a lot is batch files. The reason for this is because it allows us to copy files, registry settings, or other conditions before launching an application for a user.
A sometimes useful function is to present a person with a choice menu that enables them to use a program in different ways or with different settings. Since I’m not a hardcore programmer, a way to set this up with a batch file can be handy.
Here’s the logic
echo Please make a selection:
echo.
echo [1] selection 1
echo [2] selection 2
echo [3] selection 3
echo [4] Exit
echo.
set /p Choice=”Selection [1,2,3 or 4]: ”
echo.
for %%x in (1) do if (%Choice%)==(%%x) goto choice1
for %%x in (2) do if (%Choice%)==(%%x) goto choice2
for %%x in (3) do if (%Choice%)==(%%x) goto choice3
for %%x in (4) do if (%Choice%)==(%%x) goto Close
goto getChoice
:choice1
:: enter some command to run
goto close
:choice2
:: enter some command to run
goto close
:choice3
:: enter some command to run
goto close
It has worked well for me when I had to work around a limitation or provide flexibility for a user in certain circumstances. Grab the full batch file in text format from the link below.
Downloaded a total of 33 times

