Solved

Getting user input from 2000 bat file

Posted on 2002-03-26
13
276 Views
Last Modified: 2010-04-14
Hi,

I have a .BAT file script that runs under Win98 that prompts the user for input...it uses "Choice" and looks like this:

choice Are you sure you want to FTP TO AIX5

if errorlevel 2 goto SKIP

echo FTP Proceeding...

:SKIP

echo Finished

Can someone please tell me how this must be coded in Win2000...the "Choice" command is not supported and I have no idea what I need to use.

Thanks alot!
Andy
0
Comment
Question by:abrusko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
13 Comments
 
LVL 11

Accepted Solution

by:
geoffryn earned 100 total points
ID: 6896932
You might try using a different syntax.

echo select option
echo 1.) FTP to AIX
echo 2.) exit

%fd%\choice /c:12
If %errorlevel% == 1 goto FTP
If %errorlevel% == 2 goto exit
0
 
LVL 2

Author Comment

by:abrusko
ID: 6896963
Geoffryn,

It doesn't seem to like the

%fd%\choice /c:12

It says '\choice' is not recognized as an internal or external command, operable program or batch file.

Andy
0
 
LVL 11

Expert Comment

by:geoffryn
ID: 6896984
Sorry.  You need to set a path to choice.exe which you can get from the ResKit

 
set fd=c:\windows\system32
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 2

Author Comment

by:abrusko
ID: 6897020
Oh....I'm in a work environment...I don't have the Resource Kit...can I download it (or just choice.exe) somewhere?

Andy
0
 
LVL 11

Expert Comment

by:geoffryn
ID: 6897167
Choice.exe is a MS copywrited application.  You need to purchase the Reskit.
0
 

Expert Comment

by:dingo11
ID: 6897188
Hi,
Have you thought about using vb script to achieve the result?
Derrick
0
 
LVL 2

Author Comment

by:abrusko
ID: 6897223
Oh..ok...

To dingo11, Thanks for the suggestion.  At this point this is part of a produciton process at wrok here and the desktop just got upgraded from Win98 to Win2000, so I wanted to know if there was some quick way to alter the script for Win 2000.

So I guess we are saying that there is no way to write a script in a Windows 2000 bat file to prompt a user for input???  Is that correct???

Andy
0
 

Expert Comment

by:dingo11
ID: 6897282
Andy,
I am not 100%. The way I look at things, after learning the hard way is the right tool for the right job. The people at this site helped me see that. Sometimes I still stubborn and ignore that. I try I will do a little digging.
Here are some of my fav pit stops for batch stuff.
http://www.cableyorkton.com/users/gbraun/batch/index.htm Gord's World of Batch Files
http://www.geocities.com/SiliconValley/Foothills/4351/ Batch Creator Website
http://www.computerhope.com/batch.htm" Batch File Help
http://www.nc5.infi.net/~wtnewton/batch/batguide.html  Batch Guide
http://student.vub.ac.be/~dvandeun/batcoll.all Batch Programming Elements
http://www.nc5.infi.net/~wtnewton/batch/ Batch Programming Stuff
http://home7.inet.tele.dk/batfiles/intro/contents.htm Batfiles
http://home7.inet.tele.dk/batfiles/ Batfiles 2
http://gatsby.tafe.tas.edu.au/batch/ DOS Batch Files
http://www.easydos.com/ EasyDOS Internet Guide to DOS
http://www.calweb.com/~webspace/ Eric's Webspace
http://www.opus.co.tt/dave/index.htm" Interesting DOS programs
http://www.zdnet.com/pcmag/pclabs/solution/uuindex.htm" PC Magazine - PC Labs Online Solutions
http://www.winmag.com/library/1997/1201/howto146.htm" Power Windows - Bake a Batch of Files
http://www.calweb.com/~webspace/batch/samples/samples.htm" Sample Win9x Batch Programs
http://www.winmag.com/columns/explorer/2000/21.htm" Save Your Butt With DOS
http://www.salokin.demon.co.uk/dos.htm" Useful Site - DOS tips, utilities and links
0
 

Expert Comment

by:dingo11
ID: 6897288
Andy,
Here is a handy trick, if you have seen it my apologies.
Here is how to copy dos help stuff(eg for /?" ) to a text file.

From: smu95rp  
Yeah it's easy. I usually build up a load of quick reference like this.

For example:-

C:\>FOR /? > FOR.TXT

0
 
LVL 2

Author Comment

by:abrusko
ID: 6897494
Ok, guys...thanks for your help...I'm gonna try to see if I can get it working with either of your suggestions, so give me a day or two and then I'll shell out points to one of you...thanks again!

Andy
0
 

Expert Comment

by:dingo11
ID: 6898195
andy,
this guy has a bat alternative to choice:
http://www.robvanderwoude.com/pmadmin.html
d
0
 
LVL 2

Author Comment

by:abrusko
ID: 6899023
d,

Thanks...I'll check it out...I'm waiting to hear from our pc support group to see if we can get the Win2K resource kit...so hopefully one of these suggestions will work out for me...stay tuned....thanks.

Andy
0
 
LVL 2

Author Comment

by:abrusko
ID: 6925129
"g",

Sorry for taking so long to close this.  I'm still waiting to get that Res Kit for W2k, but I'm assuming that your suggestion will work.

Dingo11, thanks for your help and information.  I wish there was an easy way to give you some points, but I'm going to have to accept goeffryn's answer this time.

Thanks again to both of you guys.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question