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.
Your solution seems more elegant. I did it by typing the command like dir followed by "<" 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.