Sign in to follow this  
Followers 0
grindking01

Run A Program Help

6 posts in this topic

Yes i am a newbie..

In v2 i was able to make a program run, and add properties to a program as well. For instance, if i was to run the shortcut to my game.. say.. Diablo II, in the properties of this shortcut i would put -w to run the game in a window instead of having it run fullscreen.

Anyways first off, i made a .ini file. One variable would be a path/directory:

path=C:\Program Files\Game.exe

Now, at the beginning of the .au3 file, i have an ini read that works properly:

$path=IniRead("configurations.ini","Account","path","default")

Ok, so next, in the .au3 file, i want to run this game.exe program from the variable $path. So people who want this program can configure it to their likings depending on where they installed the game into their computers. Now i have tried this and tried putting in quotes, slashes, you name it to fix the problem and nothing works. It currently looks like this:

Run("$path\Game.exe", "", @SW_MINIMIZE)

And it keeps giving me errors, does anyone know how to fix this?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes i am a newbie..

In v2 i was able to make a program run, and add properties to a program as well. For instance, if i was to run the shortcut to my game.. say.. Diablo II, in the properties of this shortcut i would put -w to run the game in a window instead of having it run fullscreen.

Anyways first off, i made a .ini file. One variable would be a path/directory:

path=C:\Program Files\Game.exe

Now, at the beginning of the .au3 file, i have an ini read that works properly:

$path=IniRead("configurations.ini","Account","path","default")

Ok, so next, in the .au3 file, i want to run this game.exe program from the variable $path. So people who want this program can configure it to their likings depending on where they installed the game into their computers. Now i have tried this and tried putting in quotes, slashes, you name it to fix the problem and nothing works. It currently looks like this:

Run("$path\Game.exe", "", @SW_MINIMIZE)

And it keeps giving me errors, does anyone know how to fix this?

path=C:\Program Files\Game.exe

Run("$path\Game.exe", "", @SW_MINIMIZE)

acording to your post, this would be the same as

Run("C:\Program Files\Game.exe\Game.exe", "", @SW_MINIMIZE)

You might try:

$shortcuts=""
Run($path & " " & $shortcuts, "", @SW_MINIMIZE)

Put text elements in quotes, and variables outside of quotes. Use & to add them together.

if $path=C:\Program Files\Game.exe

"$path\Game.exe"="$path\Game.exe"

$path & "\Game.exe"=C:\Program Files\Game.exe\Game.exe

if you put $path in quotes, it is no longer a variable, but the text "$path"

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

also, before you make an INI file, I would suggest working out the bugs first.

$path="C:\Program Files\Game.exe"; until perfect
;$path=IniRead("configurations.ini","Account","path","default"); until perfect

Run($path , "", @SW_MINIMIZE)

After you know the game runs like you want it, coment out the set variable and work on your inifile.

as far as the -w you can put that in as well, and eventually put it in an InI too.

$var=" -w"; notice I put a space infront
$path="C:\Program Files\Game.exe"; until perfect
;$path=IniRead("configurations.ini","Account","path","default"); until perfect

Run($path & $var, "", @SW_MINIMIZE)
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Ok, thx guys, it helps a LOT! But for future reference how would i write something 1/2 variable 1/2 sentence?

would it be like:

$var & "sentence"?

(just along those lines i dont need a command or anything)

Share this post


Link to post
Share on other sites

Blah.. yes yes another reply forget the last 1 its bs.. I also was wondering if u can run a shortcut to a program.

Share this post


Link to post
Share on other sites

Yes, you can run a shortcut to a program, and even make a shortcut to a program.

run(@comspec &' /c "Shortcut to something.lnk"')

FileCreateShortcut

--------------------------------------------------------------------------------

Creates a shortcut (.lnk) to a file.

FileCreateShortcut ( "file", "lnk" [, "workdir", "args", "desc", "icon", "hotkey"])


AutoIt3, the MACGYVER Pocket Knife for computers.

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