JSI Tip 2655. How do I pipe a response to a command in a batch?.

Jerold Schulman

July 30, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

I have piped responses in various batch scripts on this site, but if you were trying to search for the 'how to', you may not find them.

Here are 3 solutions:

1. Some commands have a switch (/Y) which eliminates the prompt. It may not even be documented.

2. Example for responding to a prompt from the output of a command:

    echo y |

3. Example for responding to a prompt with the contents of a text file:

     <DriveLetter:Folderfilename.txt


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like