Batch file is asking if the file that I am copying is a F=file or D=directory I want to automatically answer "F" for file.
Auto answer batch file prompt
Page 1 of 13 Replies - 10241 Views - Last Post: 28 September 2010 - 09:56 PM
Replies To: Auto answer batch file prompt
#2
Re: Auto answer batch file prompt
Posted 19 November 2008 - 12:02 AM
please post some code so i`ll know what you mean!!!!!
~~~~~
normally...
if a command asks for a confirmation or smth you could use the pipe operator like this:
~~~~~
normally...
if a command asks for a confirmation or smth you could use the pipe operator like this:
echo y | del <directoryName>
#4 Guest_Just some guest*
Re: Auto answer batch file prompt
Posted 28 September 2010 - 09:56 PM
I think he means something along the lines of
Batch File:
The batch file asks him if he wants F (a file) or D (a directory) to copy, and he wants to automatically answer F EG:
So what you need to do (poster) is search for the text string it asks you.
EG: If it says
Search for: Do you want to copy a file or directory?
Then it will say something in the batch file like:
set /P variable=Do you want to copy a file or directory?
Replace that with
set variable=F
Batch File:
@echo off set /P q1=Do you want to copy a file or directory? IF /I %q1%==F (do something here) IF /I %q1%==D (do something here)
The batch file asks him if he wants F (a file) or D (a directory) to copy, and he wants to automatically answer F EG:
@echo off ::set /P q1=Do you want to copy a file or directory? (DELETE THIS LINE) set q1=F IF /I %q1%==F (do something here) IF /I %q1%==D (do something here)
So what you need to do (poster) is search for the text string it asks you.
EG: If it says
Do you want to copy a file or directory?
Search for: Do you want to copy a file or directory?
Then it will say something in the batch file like:
set /P variable=Do you want to copy a file or directory?
Replace that with
set variable=F
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|