Surgery 0 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? Share this post Link to post Share on other sites
Valuater 130 Posted October 18, 2007 The full location is needed Run("C:\In\Tonic.exe") 8) Share this post Link to post Share on other sites
Surgery 0 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? Share this post Link to post Share on other sites
Valuater 130 Posted October 18, 2007 read help Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) 8) Share this post Link to post Share on other sites
JerryD 1 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. Share this post Link to post Share on other sites
SmOke_N 211 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. Share this post Link to post Share on other sites
Surgery 0 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. Share this post Link to post Share on other sites