| | |
How can i suppress a user prompt while running a batch file in windows 2000 machin
![]() |
•
•
Join Date: Apr 2007
Posts: 6
Reputation:
Solved Threads: 0
How can i suppress a user prompt while running a batch file in windows 2000 machin
0
#1 May 2nd, 2007
Re: How can i suppress a user prompt while running a batch file in windows 2000 machin
0
#2 May 3rd, 2007
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.
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
Daylight-saving time uses more gasoline
•
•
Join Date: Apr 2007
Posts: 6
Reputation:
Solved Threads: 0
Re: How can i suppress a user prompt while running a batch file in windows 2000 machin
0
#3 May 3rd, 2007
Re: How can i suppress a user prompt while running a batch file in windows 2000 machin
0
#4 May 5th, 2007
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)
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.
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.
Daylight-saving time uses more gasoline
![]() |
Similar Threads
- recursive delete using a batch file on windows-XP (Existing Scripts)
- How can i capture a crash while running a batch file? (Windows NT / 2000 / XP)
- Batch File Question (Windows NT / 2000 / XP)
Other Threads in the Windows NT / 2000 / XP Forum
- Previous Thread: Computer will not boot past the "Windows XP home edition" screen
- Next Thread: Headache with this problem...
| Thread Tools | Search this Thread |
Tag cloud for Windows NT / 2000 / XP
.net 3.5 3daccelertion 2007 2010 activedirectory alaris android application audio auto automatically black blue book bulletin canonical cellphones chinese chkdsk collaboration computer crash deployments desktop domain dotnetnuke drive dual error errors explorer features folder fonts format hardware internet interoperability killprocess laptop laptops lcd linux load mac memory microsoft mobile monitor motionle1600 netbooks novell open operatingsystems oracle osinstallationproblem partition product proxy raid rds remotedesktopconnection repair retail retrieve rootkit screen security server. slowperformance sp1 sp3 spyware studios technology ubuntu uninstall update upgrade usb verizon videogames virtual virus vista visual volume wab webos weecam win win32/heur windows windows7 windowsxp windowsxpnotstartingup. worm xp xpde






