Surgery Posted October 18, 2007 Posted October 18, 2007 Hey, Ok, so I'm going: Run("Tonic.exe","in") because the program is in a folder called "in". But when I run the converted script it says it can't find program. I've also tried: Run("in\Tonic.exe") and i get an incorrect number of parameters error at line -1, but the program runs after i close the alert. I imagine I'm just not using the working directory parameter correctly?
Valuater Posted October 18, 2007 Posted October 18, 2007 The full location is needed Run("C:\In\Tonic.exe") 8)
Surgery Posted October 18, 2007 Author Posted October 18, 2007 So . . . than that means I can't have relative paths? I would like to have the folder that my script and the folder "in" is in able to be anywhere on the hard drive and still work. But if I use an absolute path I can't do that, right?
Valuater Posted October 18, 2007 Posted October 18, 2007 read help Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) 8)
JerryD Posted October 18, 2007 Posted October 18, 2007 So . . . than that means I can't have relative paths? I would like to have the folder that my script and the folder "in" is in able to be anywhere on the hard drive and still work. But if I use an absolute path I can't do that, right?The working directory has nothing to do with where the app is called from. Run ( 'In\Tonic.exe' ) should work if the script is in the directory above In. The working directory is the app's working directory. Think about it. If you used Run ( @comspec & ' /k', 'In' ), and you use the standard $P$G prompt, the first line in your command window would be C:\Above\In> which is your working directory.
Moderators SmOke_N Posted October 18, 2007 Moderators Posted October 18, 2007 (edited) MsgBox(64, 'File Find', _FileFind("mspaint.exe")) Func _FileFind($sFName, $hDir = @HomeDrive) Local $iPid = Run(@ComSpec & ' /c ' & 'dir "' & $hDir & "\*" & $sFName _ & '" /b /o-e /od /s /a-d', '', @SW_HIDE, 2) Return StdoutRead($iPid) EndFuncEdit:For clarity:http://www.autoitscript.com/forum/index.ph...st&p=420170My response was to the above post.You could do @ScriptDir as the $hDir parameter if you don't know it's exact path, but know it will be the scripts directory. Edited October 18, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Surgery Posted October 18, 2007 Author Posted October 18, 2007 well, Run ( 'In\Tonic.exe' ) does technically work, but I keep getting an error that says incorrect number of parameters in function call at line -1. Everything is peachy after that, but I would rather do without that little error when I run the program every time.
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