Jump to content
Sign in to follow this  
darwin

Run a shortcut

Recommended Posts

darwin

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

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
darwin

okay i placed the script in the game folder and put a shortcut of script on desktop and it works thx Jos!

Share this post


Link to post
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
Sign in to follow this  

×