lordsepid Posted August 19, 2008 Share Posted August 19, 2008 hi i'm new with this software i wanted to run an ".exe" file from temp directory but i can't locate it. i tried to use @TempDir or other macros but it didn't work. is there anything helpful in autoit that works like "%temp%" in cmdline ? Link to comment Share on other sites More sharing options...
Andreik Posted August 19, 2008 Share Posted August 19, 2008 hi i'm new with this software i wanted to run an ".exe" file from temp directory but i can't locate it. i tried to use @TempDir or other macros but it didn't work. is there anything helpful in autoit that works like "%temp%" in cmdline ? Look if @TempDir is exactly dir if you want. MsgBox(0,"TempDir",@TempDir) ShellExecute(@TempDir & "\Program.exe") When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Triblade Posted August 19, 2008 Share Posted August 19, 2008 (edited) It is possible that @TempDir does work, but you didn't put the "\" between the @TempDir and the filename.exe. Try this to see which location the @TempDir holds: MsgBox(0, "@TempDir location", "@TempDir holds this location: " & @CRLF & @TempDir) Edit: Damnit!!!! Another one who beat me It's a conspiracy I tell you! Edited August 19, 2008 by Triblade My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
lordsepid Posted August 19, 2008 Author Share Posted August 19, 2008 (edited) thanks but I've tried "\" also i've tried @HomePath , @HomeDrive and some other macros but none of them worked for me. maybe i'm using it with the wrong code. this is what i use: for example : Run("7z.exe", "@HomeDrive") or : Run("@HomeDrive\7z.exe") If i use "C:\" instead of "@HomeDrive" it works but i don't want to use the drive letter because it might change. so what should i do ? pls help me thx Andreik, i used your code and it worked but i don't understand, this is not the way that the "help" uses "ShellExecute" would you explain it to me pls ? Edited August 19, 2008 by lordsepid Link to comment Share on other sites More sharing options...
LongBowNZ Posted August 19, 2008 Share Posted August 19, 2008 Andreik, i used your code and it worked but i don't understand, this is not the way that the "help" uses "ShellExecute" would you explain it to me pls ?Help explains it perfectly to me. If you don't realize yet, the parameters with [ and ] around them are optional. Link to comment Share on other sites More sharing options...
Triblade Posted August 20, 2008 Share Posted August 20, 2008 alter : Run("7z.exe", "@HomeDrive")to : Run("7z.exe", @HomeDrive)He is most likely right.What that means is @HomeDrive is a macro.Macro's shoulden't be quoted (read: wrapped in "")Text within quotes means litteral text.So:input = outcome"@HomeDrive" = @HomeDrive@HomeDrive = C: My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) 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