How do I automate a response when I enter a command that asks for input?

John Savill

January 8, 2000

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

A. Most commands have a switch to confirm an action. For commands that require a response (e.g., a logon that asks you to enter a password), try the following command.

echo  | logon savillj

This command runs the command logon savillj. When the logon command asks for a password, the echo command echos the password with a return, thus entering your password.

You can also use the following code to echo a return.

echo.|cmd.exe

About the Author

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