Jump to content

Send one command to -> program.exe?


Recommended Posts

Posted

Is it possible to send a command to a program? Like every time i start "program.exe" the key "i" sends to the program when its open? (Or like 3 sec later when i clicked on the program.exe file the key "i" sends to the program")


Posted

Or you can do it also easily with VbScript

Set objShell = CreateObject("WScript.Shell")
'Start the program
objShell.run "C:\Program Files\Program\Program.exe"
Wscript.Sleep 2000
'Send i key
objShell.SendKeys "i"
Wscript.Sleep 500
'And enter
objShell.SendKeys "{ENTER}"
Wscript.Quit

Posted
Or you can do it also easily with VbScript

Set objShell = CreateObject("WScript.Shell")
'Start the program
objShell.run "C:\Program Files\Program\Program.exe"
Wscript.Sleep 2000
'Send i key
objShell.SendKeys "i"
Wscript.Sleep 500
'And enter
objShell.SendKeys "{ENTER}"
Wscript.Quit

Thanks! Excellent. Is it possible to add "drop support" to? Like if I drop a file on the vbs script and it open the file in the program?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...