Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

Trying to understand the difference between an executable call at the Run command versus a command prompt.

If I call the Excel executable (excel.exe) from a command prompt, it doesn’t work (Image 1).  If I call it from the run command, however, it works just fine (Image 2).  Why does the Run command know what to do with excel.exe whereas, the command prompt doesn’t?  In an effort to answer my own question, I started poking around my computer’s Environment Variables.  (I’m running W7 Pro.)  

I took a look at the Path Variable, there’s no hint of C:\Program Files\Microsoft Office (or %programfiles%\Microsoft Office).  

Is there another Environment Variable that the Run command has the privilege of using that the command prompt does not?  Or, does the difference in behavior reside somewhere else?

From-Command-Prompt.png
From-Run-Command.png
Avatar of EnriquePhoenix
EnriquePhoenix
Flag of United States of America image

you need to give it a location where its located
cd Program Files\Microsoft Office\Office12\
excel.exe
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This site has a good breakdown on how to modify your enviromental variables

http://www.voidspace.org.uk/python/articles/command_line.shtml
This is mainly due to two type of environment variable.

1) User Variable and 2) System Variable.

You can copy Path from System variable to user variable and both will work in same way for you.
Avatar of jdana

ASKER

angelIII,

You mention "registered" applications.  Is that the key?  Does the Run Command know what to do with excel.exe through the OS (Windows 7) and registry values?

J
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdana

ASKER

oBdA,

Perfect.  Thanks for the info.

J