Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending an <enter> from the command prompt

Status
Not open for further replies.

steveostash

Programmer
Nov 6, 2002
6
CA
Is there any way to send an enter comman via the command prompt, that would basically activate the "ok" button on an active window when the "ok" button is the default.
 
In a batch file or script, you could use &CHR$(13) for a carriage return, such as in the below example:

dir &CHR$(13)

Which would run the "dir" command followed by a carriage return. Not exactly what you're looking for, but might point you in the right direction for a solution.
 
BFOJ,

Your solution seems more elegant. I did it by typing the command like dir followed by &quot;<&quot; and a filename that contained just a carriage return character, i.e., dir<cr and the command & cr file are in the same directory. useful for batch files but i like your solution lots more - thanks!
 
I had tried dir < CHR$(13) , but that resulted in a syntax error, discovered that you don't need the redirect (<). Seems in the past I'd done it your way with a 2nd file that contained a CR, but you know what they say, KISS. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top