Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NT batch file error

Status
Not open for further replies.

ghosking

Technical User
Nov 8, 2002
26
GB
Hi,

I am a little new to creating batch files, essentially I want the script below to run a menu, if the user presses 1 they are taken to a setup.exe. If they hit 2 the menu quits and if they hit any other key it errors and shows the menu again. It seems to work ok in win2k but not NT 4.

Any ideas what I am doing wrong? Many thanks

:MENU
ECHO. 1) To install the Update press 1 and then enter
ECHO. 2) To quit without installing the update press 2

@ECHO OFF
set INPUT=
Set /P INPUT="Please make a selection "

If "%input%"=="1" goto NT
If /I "%input%"=="2" goto QUIT
cls
GoTo MENU

:NT
if '%OS%' == 'Windows_NT' goto INSTALL
if not errorlevel 1 goto OSERROR

:INSTALL
cls
echo.
echo. Installing software... you will be prompted to reboot when complete
setup.exe
goto QUIT

:OSERROR
cls
echo. Sorry, cannot install onto Windows 95, 98 or ME PC's
pause
exit

:QUIT
cls
echo.
echo.
echo.
pause
exit
 
I don't think NT4 supports the Set /P INPUT option. Probably your best bet is to find the CHOICE utility, available in the NT 4 Resource Kit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top