Jump to content

Run a shortcut


Recommended Posts

hello all

i made a script w/o gui which runs when i press CTRL+1 a shortcut from a game which is placed in windows directory because i tested it with notepad and some other programms which are placed in windows directory but when i try to run my shortcut it doesnt work

Hotkeyset("^{1}", "_runGame")
Hotkeyset("^{2}", "_exit")

func _exit ()
Exit
endfunc

func _runGame ()
shellexecute("game.exe")
endfunc

while 1
wend

then i get a msgbox which says "game.exe unable to find" or smth like this

sorry im new with auto it so pls tell me what i did wrong

Link to comment
Share on other sites

  • Developers

Is your script located in the same directory as the program? if not, how would it know where to find it on the disk?

Add a Sleep(50) to your While-Wend loop to avoid eating too much CPU.

also make sure you have read our forum rules!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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