Jump to content

Recommended Posts

Posted

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?

;
; AutoIt Script
; GameClient Login
; by Dorochet
; 

; Open the game client
Run("C:\GameClient.exe.lnk")

;Wait for the window to be active
WinWaitActive("GameCl


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


weaponx
            
            
                Posted 
                
            
        
    
    
        


weaponx
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                MVPs
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 5.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
I'm coming for blood, no code of conduct, no law. 
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            A fully qualified path to an EXE must be in Run() you cannot use lnk files.


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


sandman
            
            
                Posted 
                
            
        
    
    
        


sandman
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
I ❤ WordPress
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            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]
        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


flip209
            
            
                Posted 
                
            
        
    
    
        


flip209
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 305
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                    (edited)
                
                
            
        
    

    

    

    
        
        
            Try,  ShellExecute
Sorry Sandman we post at the same time, thats never happened before lol


            
                


    Edited  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
        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


dorochet
            
            
                Posted 
                
            
        
    
    
        


dorochet
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 10
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            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"


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


flip209
            
            
                Posted 
                
            
        
    
    
        


flip209
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 305
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            ; 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
        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


PsaltyDS
            
            
                Posted 
                
            
        
    
    
        


PsaltyDS
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                MVPs
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 13.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        1
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
Most Venerable Penguin
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            
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
Posted (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 by dorochet

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
×
×
  • Create New...