VBscript to Send Key Strokes (Auto Response) to the Windows Applications

Here is a very simple and quick VBscript that can automated press OK on your Windows Run prompt. If you have any of the command types in your Run box, that gets executed simply by running this script.

set shell = createobject("wscript.shell")
wscript.sleep 200
success = shell.appactivate("Run")
if success then shell.sendkeys "{tab}"
wscript.sleep 400
shell.sendkeys "{enter}"

 

Steps:

  1. Open the Run, (use Windows key + R)
  2. Type cmd in the Run box
  3. Open the Explorer where you have the above code saved as .vbs script
  4. Double click on the .vbs script file for it to run
  5. That’s it will see the command prompt opened up in front of you.

Leave a Reply

Your email address will not be published. Required fields are marked *