Sign in to follow this  
Followers 0
narayanjr

Run(filename)

8 posts in this topic

winactivate("Diablo II")

winmove("Diablo II","",0,0)

;Run("Diablo II.exe", "C:\Program Files\Diablo II\Diablo II.exe")

WinWait("Diablo II")

I have tried using

winactivate("Diablo II")

winmove("Diablo II","",0,0)

and it worked one time but then hasn't worked since then

then i tried

Run("Diablo II.exe", "C:\Program Files\Diablo II\Diablo II.exe")

and that doesn't work at all but i can get it to start notepad

any idea what I am doing wrong?

Thanks

Share this post


Link to post
Share on other sites



The issue would appear to be your run line.

Notepad.exe resides in the "system32" folder of windows, this is listed in whats known as the "PATH Variables"

You can call a .exe file that in a directory declared in the parth variables, without its entire location.

In this case, diablo II.exe is not in the path.. try this instead:

Run("C:\Program Files\Diablo II\Diablo II.exe", "C:\Program Files\Diablo II\")

It specifies the program to run with a full directory to its executeable, and declares the directory to start it in (so it can find supporting files etc) is the directory it is located in.

also, not sure if autoIT will see the window name for diablo 2 unless you are running it in window mode.

Share this post


Link to post
Share on other sites

that did work but when i do it that way it uses the one without the command line parameters

Run("C:\Program Files\Diablo II\Diablo II.exe" -mpq cdkey4.mpq -skiptobnet -w -title "Diablo II", "C:\Program Files\Diablo II\")

i need somthing like that but it doesnt like the added ""

is there a way to make it run a shortcut that already has the command parameters

or can i make that line of code work with the right combination of "" or '' or something else

Share this post


Link to post
Share on other sites

still cant get it to work with parameters any ideas?

Thanks

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Run('"C:\Program Files\Diablo II\Diablo II.exe" -mpq cdkey4.mpq -skiptobnet -w -title "Diablo II"')

mmm must be some Admin playing with the code stuff ...:)

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

what?

Share this post


Link to post
Share on other sites

Thank you that worked i just had to had the working dir for it to work the right way

without it it brought up the game but it was missing some kind of check so it wouldnt let me connect to the internet

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  
Followers 0