miketh2005 Posted August 18, 2009 Share Posted August 18, 2009 Hello, I'm trying to use the Run function, but the helpfile doesn't clarify how to use the "workingdir" parameter. I'm trying to do: Run("Soldat.exe", "C:/Soldat") But it doesn't work, even though I have Soldat.exe in the directory "C:/Soldat". Link to comment Share on other sites More sharing options...
Hawkwing Posted August 18, 2009 Share Posted August 18, 2009 (edited) Why not just doRun("C:\Soldat\Soldat.exe")Or, as it is in the other post on this exact same topicRun($var & "Soldat.exe") Edited August 18, 2009 by Hawkwing The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 18, 2009 Share Posted August 18, 2009 Try Run("Soldat/Soldat.exe", "C:/Soldat") - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
miketh2005 Posted August 18, 2009 Author Share Posted August 18, 2009 Why not just do Run("C:\Soldat\Soldat.exe") That works! Thanks! Why didn't they say that in the helpfile? :/ Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 18, 2009 Share Posted August 18, 2009 It does. The first parameter is the path to the executable. That's as explicit as it gets. Link to comment Share on other sites More sharing options...
miketh2005 Posted August 19, 2009 Author Share Posted August 19, 2009 It does. The first parameter is the path to the executable. That's as explicit as it gets. It would be good is that's what it actually said in the helpfile, but it does not. It says: Parameter Description filename The name of the executable (EXE, BAT, COM, or PIF) to run. workingdir [optional] The working directory. It says the filename, not the path to the filename. Link to comment Share on other sites More sharing options...
BrettF Posted August 19, 2009 Share Posted August 19, 2009 Search would have received even more results... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 19, 2009 Share Posted August 19, 2009 I have submitted a ticket to the trac requesting a documentation change. #1139 Link to comment Share on other sites More sharing options...
miketh2005 Posted August 20, 2009 Author Share Posted August 20, 2009 Search would have received even more results...I'm sorry. I always forget that ;/ thanks for reminding me. Thanks richard for submitting that ticket. Link to comment Share on other sites More sharing options...
trancexx Posted August 20, 2009 Share Posted August 20, 2009 I'm just reading v3.3.1.1 (beta) help file and this is fixed there. Ticket is redundant. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 20, 2009 Share Posted August 20, 2009 Hello, I'm trying to use the Run function, but the helpfile doesn't clarify how to use the "workingdir" parameter. I'm trying to do: Run("Soldat.exe", "C:/Soldat") But it doesn't work, even though I have Soldat.exe in the directory "C:/Soldat". Just so you know you had this exactly right, except the problem you are experiencing is the wrong direction for a directory slash \ = operating system directory where as / = web application directory. Try the following (even though you have working code)Run("Soldat.exe", "C:\Soldat") Let me know if that works for you. Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
miketh2005 Posted August 21, 2009 Author Share Posted August 21, 2009 Just so you know you had this exactly right, except the problem you are experiencing is the wrong direction for a directory slash \ = operating system directory where as / = web application directory. Try the following (even though you have working code)Run("Soldat.exe", "C:\Soldat") Let me know if that works for you. Jarvis Nope, doesn't work. Link to comment Share on other sites More sharing options...
BrettF Posted August 21, 2009 Share Posted August 21, 2009 It would only work if the .exe was in the script folder... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 21, 2009 Share Posted August 21, 2009 (edited) Nope, doesn't work.It works for me...read below for details.It would only work if the .exe was in the script folder...Incorrect. That's what the working directory is for (changes run location).Edit01: BrettF your statement would only be true with the following code as that would imply the run directory is the working directory.Run("Soldat.exe")Please perform the following steps to confirm what I have done.Create Folder "Soldat" on the C:\ DriveCreate a script as follows...(Soldat.au3)MsgBox(0, "Test", "Success!")Compile that script as Soldat.exePlace that script in C:\Soldat\ directoryWrite another script in C:\Documents and Settings\Username\My Documents\Personal\AutoIt\SoldatTest.au3Run("Soldat.exe", "C:\Soldat")Compile that script as SoldatTest.exeRun it from the AutoIt folder.Result: Message box showing "Success!" is popped up. My working directory is as stated above.If anyone can produce different results let me know.Thanks,Jarvis Edited August 21, 2009 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 21, 2009 Share Posted August 21, 2009 I'm just reading v3.3.1.1 (beta) help file and this is fixed there.Ticket is redundant.Whoops. I checked the online copy of the help documents, so I didn't know about that.It works for me...read below for details.Incorrect. That's what the working directory is for (changes run location).Edit01: BrettF your statement would only be true with the following code as that would imply the run directory is the working directory.Run("Soldat.exe")Please perform the following steps to confirm what I have done.Create Folder "Soldat" on the C:\ DriveCreate a script as follows...(Soldat.au3)MsgBox(0, "Test", "Success!")Compile that script as Soldat.exePlace that script in C:\Soldat\ directoryWrite another script in C:\Documents and Settings\Username\My Documents\Personal\AutoIt\SoldatTest.au3Run("Soldat.exe", "C:\Soldat")Compile that script as SoldatTest.exeRun it from the AutoIt folder.Result: Message box showing "Success!" is popped up. My working directory is as stated above.If anyone can produce different results let me know.Thanks,JarvisI'm surprised that works. The working directory has nothing to do with the list of directories used to find an executable. Link to comment Share on other sites More sharing options...
BrettF Posted August 21, 2009 Share Posted August 21, 2009 Wow, that is surprising. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 22, 2009 Share Posted August 22, 2009 My guess is that AutoIt will now set the working directory and then run the application, in that order. Link to comment Share on other sites More sharing options...
Scriptonize Posted August 22, 2009 Share Posted August 22, 2009 I've always thought that the working folder doesn't need to be the same as the exe folder. >_< The exe can be in c:\program files\myprog\myprog.exe Myprog.exe can have a file open in c:\test. Isn't (in my example) the working folder c:\test ? If you learn from It, it's not a mistake Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 22, 2009 Share Posted August 22, 2009 Yes that's partially true. The working directory and the executing directory do not have to be the same. Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 23, 2009 Share Posted August 23, 2009 Well I am happy I could surprise! >_< I know that Soldat.exe isn't in the %PATH% environment variable, and because it's outside my running directory, I had to specify the working directory so AutoIt would know where to find it. Regards, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) 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