Jump to content

Recommended Posts

Guest Guest_gasman
Posted

When I run my script testit.au3

The 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

Posted

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.

Guest Guest
Posted

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

Posted

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

Posted

When I run my script testit.au3

The 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

The command is probably in the path which is why it works with @comspec

You may need to specify the path of the command without @comspec

Rick

Guest Guest
Posted

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

Guest gasman
Posted

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

Posted

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

Each time you've specified the path of the exe

It works great job

Rick

Guest gasman
Posted

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

  • Developers
Posted

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 window

So 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.
  :)

Posted

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=

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...