944,161 Members | Top Members by Rank

Ad:
May 2nd, 2007
0

How can i suppress a user prompt while running a batch file in windows 2000 machin

Expand Post »
How can i suppress a user prompt while running a batch file in windows 2000 machine??
thanks in advance.
Abhishek
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abhishekshete is offline Offline
6 posts
since Apr 2007
May 3rd, 2007
0

Re: How can i suppress a user prompt while running a batch file in windows 2000 machin

It depends on what you are doing.

Some commands have a /b or /n switch to tell them they are being run from a batch file (and to suppress prompts.)

Another way is to have input and output redirection. But the input file must have all of the correct responses in the correct order (and the batch file can go horribly wrong if an unexpected error prompt appears. Put the redirection in the command line that starts the batch file, or in the batch file line which starts the command.

< redirects input, > redirects output, >> redirects error messages. There must be no space between the redirection sysmbol and the file.

dothis.bat <promansr.txt >digester.txt
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 3rd, 2007
0

Re: How can i suppress a user prompt while running a batch file in windows 2000 machin

I didnt get a clear cut picture. Can u plz explain it with an example.But the >> is a command for appending.
Thanks in advance,
Abhishek.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abhishekshete is offline Offline
6 posts
since Apr 2007
May 5th, 2007
0

Re: How can i suppress a user prompt while running a batch file in windows 2000 machin

You are right, I was thinking of the OS-9 similar redirections. DOS uses >> for append.

In my example, dothis.bat is the batch file.

promansr.txt is a text file full of the expected responses to prompts, one response per line.


e.g. (I put the question over to the right. it is not part of the file)

y        (are you sure?)
n        (send to printer?)
          (Press ENTER to continue.)
y        (Replace the file? y/n/c=cancel)

digester.txt takes all of the output and "digests" it. You need to remove the file between runs of the batch file. You can do this by calling another batch file which deletes the file (and the two batch files could delete each other's files).

ECHO OFF

this command as the first line of a batch file also removes a lot of queries.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Windows NT / 2000 / XP Forum Timeline: Computer will not boot past the "Windows XP home edition" screen
Next Thread in Windows NT / 2000 / XP Forum Timeline: Headache with this problem...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC