Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Send an (enter) to a runas command without user input

I have a need to perform a runas command, and send an enter keypress to the command without user interaction.

I understand that piping results out to a file, but i want to do it the other way, send n enter keypress to the command.

This is the command

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

runas.exe /user:XXX\USER_LOGIN notepad.exe

When this command is run, it prompts for a password… i dont want to supply a password, just press the enter key.

FYI – this is a very simple user refresh, so it doesn’t go stale when not used in a while.

>Solution :

Try piping in a blank quoted string:

echo "" | runas.exe /user:XXX\USER_LOGIN notepad.exe

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading