Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Batch File.....CHOICE command in XP

Original Message
Name: ffxifanatic
Date: September 13, 2003 at 09:16:14 Pacific
Subject: Batch File.....CHOICE command in XP
OS: WindowsXP HOme Editition
CPU/Ram: 256DDR
Comment:
I am running XP but i need a batch file that uses something like the choice command available in 98. Is there another command like it in XP that i can use....for example i want to be able to do the following:
choice/c:123456 %1
if errorlevel 6 GOTO VERIFY
if errorlevel 5 GOTO NO5
if errorlevel 4 GOTO NO4
if errorlevel 3 GOTO NO3
if errorlevel 2 GOTO NO2
GOTO NO1
but i always get a looping message saying choice is unknown batch file command.....


Report Offensive Message For Removal


Response Number 1
Name: Nathan
Date: September 13, 2003 at 11:28:49 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
yes its called set /p. I'm going to keep this brief so just copy this code

@echo off
:start
cls
set /p userinp=choose a number(1-6):
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto 1
if "%userinp%"=="2" goto 2
if "%userinp%"=="3" goto 3
if "%userinp%"=="4" goto 4
if "%userinp%"=="5" goto 5
if "%userinp%"=="6" goto 6
echo invalid choice
goto start
:1
(do stuff here)
goto end
:2
(do more stuff here)
goto end
:3
stuff
goto end
etc.
:end
pause>nul



Report Offensive Follow Up For Removal

Response Number 2
Name: ffxifanatic
Date: September 13, 2003 at 19:20:02 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
Will this command also work in Windows98? My problem is the school has Win98 and I have XP. If this command works for both that's even better.
thx:)

Report Offensive Follow Up For Removal

Response Number 3
Name: Nathan
Date: September 13, 2003 at 21:21:44 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
no set /p is only avialable for the NT family I believe(dont quote me). another option would be to dualboot you HD so for school work you can launch win 98. another option would be to "take" the windows 98 choice command and put it into xp.

Report Offensive Follow Up For Removal

Response Number 4
Name: ffxifanatic
Date: September 13, 2003 at 23:48:39 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
Ok, i like taking the choice command option.....any idea how i can do that?
thx:)

Report Offensive Follow Up For Removal

Response Number 5
Name: IVO
Date: September 14, 2003 at 06:14:01 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
To take the "Choice" command from Windows 98 simply locate it (it is likely stored in C:\windows\command directory), send it to a floppy and then load it into the directory where you save your batch files in Windows XP.
It is not a true legal procedure, but I think Bill Gates may tolerate that.

Report Offensive Follow Up For Removal


Response Number 6
Name: Nathan
Date: September 14, 2003 at 13:50:20 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
couldnt have said it better mysely. thanks IVO

Report Offensive Follow Up For Removal

Response Number 7
Name: MargaretB
Date: September 17, 2003 at 09:02:46 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
I'm trying to do something similar in XP, where I want the user to type in a filename for a .PRN file and then have the batch file send the .PRN file to the printer. Using the example above, I get the prompt I wanted, but the program does not appear to "take in" the input. I type the filename, nothing appears, and the program doesn't move on to the next step. I'm stuck there. Is there a different format required for inputting a string rather than a one-character number?

Thanks.


Report Offensive Follow Up For Removal

Response Number 8
Name: ffxifanatic
Date: September 17, 2003 at 10:17:05 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
yup, i moved it over to XP and nothings going wrong now. Thx to Nathan and IVO for that.

sorry MargaretB, i have no idea....but im gonna guess its got to do something with quotes.


Report Offensive Follow Up For Removal

Response Number 9
Name: Nathan
Date: September 17, 2003 at 17:45:38 Pacific
Subject: Batch File.....CHOICE command in XP
Reply: (edit)
hey margeret, post the batch file your useing

Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch File.....CHOICE command in XP

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




acer 312T BIOS problem

K7 Turbo possible max fsb?

Pc anywher problem

WinFLP & OE/Outlook2003

Computer resets after a few minutes


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC