Jump to content
Sign in to follow this  
myxomatosii

Simple "Run" Question

Recommended Posts

myxomatosii

I don't understand why this won't run firefox when I can just type "firefox.exe" into windows and it does it fine. :P

Run("firefox.exe",@ProgramFilesDir&"\Mozilla Firefox")

Share this post


Link to post
Share on other sites
BrettF
myxomatosii

2nd Param is NOT the folder where the first param is located. Really, please search for that...

:P

I was born near a large cache of plutonium, in my asbestos house under electrical wires.

Share this post


Link to post
Share on other sites
BrettF
myxomatosii

So what is the difference between workingdir and dir where file is located?

I looked at the helpfile and I still understand it the same as I did before..

tried @programfilesdir @desktopdir @windowsdir and lots of others, none launched it..

in the example they just run notepad, thats not very helpful considering its an exceptional program that runs out of a directory that regular programs do not

it doesn't really help someone understand how to run anything except windows built-in apps..

Edited by myxomatosii

Share this post


Link to post
Share on other sites
BrettF
CodyBarrett

are you sure that is the name of the .exe?.... then KNOW the exact directory path, or put the script into the same folder as it and use @Scriptdir..... @workingdir is just where the script is looking. default is @scriptdir

Share this post


Link to post
Share on other sites
BrettF

Okay, fail search.

Lets look at the syntax.

Run ( "filename" [, "workingdir" [, show_flag[, opt_flag ]]] )

Workingdir is not used to tell AutoIt where the exe is located; rather it is used to specify where the exe is working. Google it :P

You should put the full path in "filename", yes it is missleading, but put the full path to the exe here.

And now here is an example for running a random program, where we set the working dir to the same as the exe.

Run ("C:\Path\Goes\Here\This.exe", "C:\Path\Goes\Here")

Cheers,

Brett

Share this post


Link to post
Share on other sites
evilertoaster

hen I can just type "firefox.exe" into windows and it does it fine

You're probably wanting the more precise functionality of the _RunDOS() function then.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×