Guest Guest_gasman Posted June 18, 2004 Share Posted June 18, 2004 When I run my script testit.au3The following statement works.$prog_dir= "C:\Progra~1\Wildli~1\WC-GPE\"RunWait(@comSpec & " /c " & $prog_dir & "XX-ACP.1.01.2004.exe", "",@SW_HIDE);It launches the program XX-ACP.1.01.2004.exe just fine.If I comment out that line and put this one under it... Run("XX-ACP.1.01.2004.exe", $prog_dir)I get an error which says it can not find the file. There are no typing errors here!Bug?Any idea what might be going on?-g Link to comment Share on other sites More sharing options...
Guest Guest Posted June 18, 2004 Share Posted June 18, 2004 better of without cmd Link to comment Share on other sites More sharing options...
pekster Posted June 18, 2004 Share Posted June 18, 2004 I'm not sure if this will work or not, but how about removing the trailing backslash when you want to use the 2nd paramater of Run (the working directory) ? Maybe it will do something different. If not, you might want to post this in the bugs forum. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Guest Guest Posted June 18, 2004 Share Posted June 18, 2004 Trailing slash or no trailing slash it doesn't work. Any other ideas how to launch this program so I can continue to use the script? -g Link to comment Share on other sites More sharing options...
Arctor Posted June 18, 2004 Share Posted June 18, 2004 Run("c:\windows\notepad.exe","", @SW_MINIMIZE) Run("notepad.exe", "c:\windows", @SW_MINIMIZE) Run("notepad.exe", "c:\windows\", @SW_MINIMIZE) I just tried these 3 ways. All worked arctor Link to comment Share on other sites More sharing options...
tutor2000 Posted June 18, 2004 Share Posted June 18, 2004 When I run my script testit.au3The following statement works.$prog_dir= "C:\Progra~1\Wildli~1\WC-GPE\"RunWait(@comSpec & " /c " & $prog_dir & "XX-ACP.1.01.2004.exe", "",@SW_HIDE);It launches the program XX-ACP.1.01.2004.exe just fine.If I comment out that line and put this one under it... Run("XX-ACP.1.01.2004.exe", $prog_dir)I get an error which says it can not find the file. There are no typing errors here!Bug?Any idea what might be going on?-gThe command is probably in the path which is why it works with @comspec You may need to specify the path of the command without @comspecRick Link to comment Share on other sites More sharing options...
Guest Guest Posted June 18, 2004 Share Posted June 18, 2004 I'll give that a shot, thanks. However, I did discover that this work! Praise the Saints!!! Run("C:\Progra~1\Wildli~1\WC-GPE\XX-AMP.1.01.2004.exe") without bothering with the directory parameter. ... which leads me to believe either the documentation needs updating in terms of how to actually use Run, or there is a bug. -g Link to comment Share on other sites More sharing options...
Guest gasman Posted June 18, 2004 Share Posted June 18, 2004 In fact, this works as well? Run($prog_dir & "XX-AMP.1.01.2004.exe) .... which isn't exactly the way it is described in the help. -g Link to comment Share on other sites More sharing options...
tutor2000 Posted June 19, 2004 Share Posted June 19, 2004 In fact, this works as well?Run($prog_dir & "XX-AMP.1.01.2004.exe).... which isn't exactly the way it is described in the help.-gEach time you've specified the path of the exeIt works great jobRick Link to comment Share on other sites More sharing options...
Guest gasman Posted June 21, 2004 Share Posted June 21, 2004 It isn't that I'm specifying the path.... the documentation suggests the command format should be: Run(program,path) My experiences suggest that doesn't work! However these forms did: Run($path & $program) Run("/directory_path/program") However, they aren't exactly working as they should, but they do launch the program. -g Link to comment Share on other sites More sharing options...
Developers Jos Posted June 21, 2004 Developers Share Posted June 21, 2004 the helpfile says: Run ( "filename" [, "workingdir" [, flag]] ) Parameters filename - The name of the executable (EXE, BAT, COM, or PIF) to run. workingdir [optional] The working directory. flag [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized windowSo the Path parameter is the working dir. I think it is a good suggestion that the Helpfile should say something like: "filename - The full path\name of the executable (EXE, BAT, COM, or PIF) to run." Because this seems to be a constant returning question.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
midiaxe Posted June 21, 2004 Share Posted June 21, 2004 Looking at the doc, the syntax for Run is: Run( "filename" [, "workingdir" [, flag]] ) I think that the second parm (workingdir) is the initial directory where you want your application (1st parm) to look at if it needs to open/create a file (when not using a fully qualified path for the file). When I use Run/RunWait, I always fully qualify the path of my executable in parm 1. =MX= 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