grindking01 Posted March 31, 2004 Posted March 31, 2004 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?
scriptkitty Posted March 31, 2004 Posted March 31, 2004 (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 March 31, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
scriptkitty Posted March 31, 2004 Posted March 31, 2004 (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 March 31, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
grindking01 Posted April 1, 2004 Author Posted April 1, 2004 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)
grindking01 Posted April 1, 2004 Author Posted April 1, 2004 Blah.. yes yes another reply forget the last 1 its bs.. I also was wondering if u can run a shortcut to a program.
scriptkitty Posted April 1, 2004 Posted April 1, 2004 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.
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