Dan44


I am trying to answer a prompt in the command prompt window programmatically so the user does not see the prompt nor have to interact with it.

I have tried ECHO, but it does not put the text after the prompt.

Also, how do you add the text and continue -- that is, simulate pressing the ENTER key

I am totally new to this, so any ideas will help.

Thanks!

Sample:

ECHO [text to send]



Re: Answer command prompt programmatically

Anarchy


try SendKeys, never used it, but might do what you want





Re: Answer command prompt programmatically

Tall Dude

Some programs, not all, will accept redirection (from

a batch file.)

In other words, say program zzz.com stops at

some point and wants a 'Y' or 'N' for an answer

and also an enter.

If you create a text file (Use notepad or similar,)

that is simply the letter 'Y' and a CRLF and

name it C:\Y.FIL.

Then in your batch file, you would say:

zzz < C:\y.fil

on one line.

Tip: To make quick short files from the command prompt

use a 'copy from console' command.

COPY CON C:\Y.FIL (Then hit enter)

(Type the complete file and then hit Ctrl-Z)