dorochet Posted August 29, 2007 Share Posted August 29, 2007 Ok when I run this script I get one of two errors. In the code below, I try to activate the shortcut to the program I want to run. I get an error in line 8 saying it can't run the external program. I have also inserted the directory of the actual .EXE file. This say Error can't run Client.ini, which is the configuration file for the Gameclient. However, if I run that same directory in the windows Run box, the client opens up just fine. Any ideas? expandcollapse popup ; ; AutoIt Script ; GameClient Login ; by Dorochet ; ; Open the game client Run("C:\GameClient.exe.lnk") ;Wait for the window to be active WinWaitActive("GameCl Link to comment Share on other sites More sharing options... weaponx Posted August 29, 2007 weaponx MVPs 5.3k I'm coming for blood, no code of conduct, no law. Share Posted August 29, 2007 A fully qualified path to an EXE must be in Run() you cannot use lnk files. Link to comment Share on other sites More sharing options... sandman Posted August 29, 2007 sandman Active Members 1.3k I ❤ WordPress Share Posted August 29, 2007 Try using ShellExecute() if you want to use the .lnk. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options... flip209 Posted August 29, 2007 flip209 Active Members 305 Share Posted August 29, 2007 (edited) Try, ShellExecute Sorry Sandman we post at the same time, thats never happened before lol Edited August 29, 2007 by flip209 " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options... dorochet Posted August 29, 2007 dorochet Members 10 Author Share Posted August 29, 2007 As I mentioned I used a second path straight to the .exe, which I will give below. If I run this path from the windows run line the client opens without issue. When I run my script, I get the error: Unable to open Client.ini. This is the configuration file for the game client. Why is there a problem when this is run with a script and not when run through windows? "C:\Program Files\Galactica\GameClient\GameClient.exe" Link to comment Share on other sites More sharing options... flip209 Posted August 29, 2007 flip209 Active Members 305 Share Posted August 29, 2007 ; Open the game client Run("C:\GameClient.exe.lnk") <<<< is not a an exe Run will only do .exe, .bat, ect... You need a "Shell" or windows shell to run a windows link or .lnk file. " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options... PsaltyDS Posted August 30, 2007 PsaltyDS MVPs 13.1k 1 Most Venerable Penguin Share Posted August 30, 2007 As I mentioned I used a second path straight to the .exe, which I will give below. If I run this path from the windows run line the client opens without issue. When I run my script, I get the error: Unable to open Client.ini. This is the configuration file for the game client. Why is there a problem when this is run with a script and not when run through windows? "C:\Program Files\Galactica\GameClient\GameClient.exe" If you are passing the .exe to Run() and it is not finding other required files, then you need to set the working dir also: Run("C:\Program Files\Galactica\GameClient\GameClient.exe", "C:\Program Files\Galactica\GameClient")oÝ÷ Øò¢ìÛhºÇ)䶧Ýý²W¬²X¤z«z«¢ç[yÆ®±ëa{ +)àv*ÜjvÞuçâçbÈy©bGâæî¶Øb²ÈhºWp¢¹,É«¢+ÙM¡±±áÕÑ ÅÕ½ÐíèÀäÈíAɽɴ¥±ÌÀäÈí±Ñ¥ÀäÈíµ ±¥¹ÐÀäÈíµ ±¥¹Ð¹á¹±¹¬ÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíèÀäÈíAɽɴ¥±ÌÀäÈí±Ñ¥ÀäÈíµ ±¥¹ÐÅÕ½Ðì¤ Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
dorochet Posted August 30, 2007 Author Share Posted August 30, 2007 (edited) Thank you again sir, sorry for the double post, dunno what happened maybe i had another browser window open or something. The code worked fine once I specified the working directory. Edited August 30, 2007 by dorochet Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now