Jump to content

Run()


Guest iwod
 Share

Recommended Posts

1. I was wondering if %CDROM% is supported, and others like %SYSTEMFILE%....

2. I read the example notepad.exe, Do you mean when placing the file within the same directory as notepad.exe, then simple pointing to notepad.exe will run?

Link to comment
Share on other sites

1. I was wondering if %CDROM% is supported, and others like %SYSTEMFILE%....

2. I read the example notepad.exe, Do you mean when placing the file within the same directory as notepad.exe, then simple pointing to notepad.exe will run?

<{POST_SNAPBACK}>

1. Look up the DriveGet functions and the @macros like @SystemDir and @ScriptDir

2. Defaults to the same folder as the script currently resides, I believe.

3. Set the specific folder by defining it before the executable. Example: Run("C:\some\folder\somefile.exe","C:\some\working\folder")

Notepad runs because the executable resides on the %PATH%

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Guest PJ_in_Fla

Notepad runs because the executable resides on the %PATH%

(NEWBIE ALERT!)

I was just going to post this question as I complete my very FIRST script (to open several programs and set up the windows, etc.), but your response is the answer to my question ...

Why does Run("program.exe") fail but Send("#rprogram.exe") work?

Your answer referring to %PATH% was the difference.

Now, does anyone know just HOW Windows (Win2K in my case) knows where executibles are to run them when they are buried somewhere in the Program Files folders?

(/NEWBIE ALERT!)

Questionably yours,

PJ in Sunny Florida

Link to comment
Share on other sites

Windows also uses the registry. Specifically, if an executable has an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths, then the path specified in the registry will be used. If you get to looking around at some of the sub-keys below that, you'll see a lot of the programs there. Some of these are the ones located in your Program Files directory, so this is how Window's is able to find them, even though their specific directory isn't in the %PATH% variable.

Link to comment
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
 Share

  • Recently Browsing   0 members

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