1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Executing a program from Run

Discussion in 'Windows XP' started by MnInShdw, 2004/03/27.

Thread Status:
Not open for further replies.
  1. 2004/03/27
    MnInShdw

    MnInShdw Inactive Thread Starter

    Joined:
    2002/07/12
    Messages:
    92
    Likes Received:
    0
    Hi all,
    Is there any way to execute a program from run command (without typing the whole path)?

    In start-run we can type Notepad for launching notepad or regedit to launch registry editor or only a dot(.) to launch windows explorer.

    I have a program for monitoring my network and it would be a great help if I be able to launch it from run command without typing the complete path to the program.

    thanks for any kind of hint.
     
  2. 2004/03/28
    Abraxas

    Abraxas Inactive

    Joined:
    2002/08/16
    Messages:
    2,361
    Likes Received:
    3
    Programs will run from the Run box if their path is defined, or if the path is defined in the PATH environment variable.

    To see what the PATH varaible looks like, go to Start > Run, and type:
    cmd

    At the prompt, type:
    set

    This shows the values of all the environment variables. Find the one that says "path ". Those are the paths that will run from the Run box.

    So, if "path" is:

    Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Support Tools\;C:\Program Files\ATI Technologies\ATI Control Panel\

    any program in any folder defined there will run from the Run box.

    You don't want to multiply the path variables unnecessarily, but adding another won't hurt.

    So, if your program were in the "Function" folder in "Program Files" and you wanted to run it from the Run box, you would just add the C:\Program Files\Function folder to the path variable. It would then read like this:

    Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Support Tools\;C:\Program Files\ATI Technologies\ATI Control Panel\;C:\Program Files\Function\

    You would then go back to your command window and type:

    SET PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Support Tools\;C:\Program Files\ATI Technologies\ATI Control Panel\;C:\Program Files\Function\

    Be careful you don't mistype or you may be in trouble!
     
    Last edited: 2004/03/28

  3. to hide this advert.

  4. 2004/03/28
    MnInShdw

    MnInShdw Inactive Thread Starter

    Joined:
    2002/07/12
    Messages:
    92
    Likes Received:
    0
    Abraxas,

    Thanks a million for all the time you spent on explaining the solution in details.

    I opened command prompt and typed Set.
    I found the path line and typed :
    SET PATH= plus the whole path line I had several lines above and at the end I added the complete path to my program.
    Closed Command prompt and launched it once more to check the result. The path to my program had gone and the path line had changed to what it was before.

    Am I missing anything?

    Any kind of help is much appreciated.
     
  5. 2004/03/28
    ackerberg

    ackerberg Inactive

    Joined:
    2002/02/02
    Messages:
    869
    Likes Received:
    2
    Use the browse button

    I almost always do installations of new programs using RUN and the browse button to find the executable program, *.exe. Why do you have to write out the complete path when you can just browse to the program. You are very apt to make a mistake typing a long path name. Use the browse button, or maybe you know something I don't about why I should not use it?
     
  6. 2004/03/28
    noahdfear

    noahdfear Inactive

    Joined:
    2003/04/06
    Messages:
    12,178
    Likes Received:
    15
    Run box has auto complete on by default, I believe, and if you type it once, you only have to open the menu and select it thereafter.
     
  7. 2004/03/28
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    To add the folder to your path, right click on my computer>properties>advanced. Click the environmental variables button. In the bottom box where it says system variables, click on path and then click the edit button. Then add the path to the folder to the end of the line. Be sure to put a semi colon between the last entry in the current path and the folder path you're going to add.
     
    Last edited: 2004/03/28
  8. 2004/03/28
    Angel71

    Angel71 Inactive

    Joined:
    2003/09/01
    Messages:
    83
    Likes Received:
    0
    The other method is to add an entry to App Paths in the registry.
     
  9. 2004/03/28
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Rather than move the executable or script/program to a defined path, couldn't you just put a shortcut in one of the defined path directories?

    And a shortcut can have any name at all, thus if your program is called "my_program.exe ", and you make a shortcut and put it in a defined path directory, and then rename the shortcut to "myprg "...or "my "...or "mp" etc etc.
     
    Last edited: 2004/03/28
  10. 2004/03/28
    ackerberg

    ackerberg Inactive

    Joined:
    2002/02/02
    Messages:
    869
    Likes Received:
    2
    Does not have to be in path!

    Some comments in this thread would leave one to believe that you can not run a program unless it is in the PATH set by running 'cmd' and then 'set' to find the paths.
    This has not been my experience at all. If you bring up RUN and then hit browse to look for a *.exe program, every file on the C drive is available for running a program in the file.The path C:\Folder\anything.exe, where folder can have any name is not one of the paths shown by 'set'. I have a folder named "Download" on C and I run programs *.exe in it all the time using RUN. Please explain this discrepancy.
     
  11. 2004/03/28
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    I don't think anybody is inferring this. You can do as you say using the browse button but what we're talking about here is starting an app by simply typing the name of the app in the run box. If you have an app named runme.exe and it's located in a folder that's in the path, all you have to do to run it using the run box is type runme. The puter will look for an exe file in the path named runme. If it finds it, it opens it. If no such file exists (in the path) you'll get an error message. For many, it's much quicker to just type the name of the file than to have to browse through all the folders to open it.
    You can do this too but you have to add the lnk extension when you type the name in the run box. If you create a shortcut to runme.exe in your windows folder and rename it to runme, you can't type just runme. You'd have to type runme.lnk. This is really no big deal and would probably be a decent work around if you didn't want to add runme.exe's folder to the path.
     
  12. 2004/03/28
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    On the same tokem, it may be beneficial for those who run such a program frequently to map a set of keys to the programs so that key combination launches the specified program. Much faster than using the run dialog.
     
    Last edited: 2004/03/28
  13. 2004/03/28
    Johanna

    Johanna Inactive Alumni

    Joined:
    2003/03/08
    Messages:
    2,402
    Likes Received:
    2
    Thanks everybody, I learned a lot, and I took notes. I am so lazy that I just make shortcuts for those frequent programs, assign them an icon I can remember and put them on my Quick Launch bar. :D

    I appreciate you guys explaining that.
    Johanna
     
  14. 2004/03/28
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    I'm with you Johanna. I'm a quick launch fan too, but there are some that still prefer using the run box or the command line. Different strokes for different folks. :)
     
  15. 2004/03/29
    Abraxas

    Abraxas Inactive

    Joined:
    2002/08/16
    Messages:
    2,361
    Likes Received:
    3
    Thanks, Zander for pointing to the environment variables permanently. I thought my way was shorter, but it really isn't even if the paths had been permanent and it had worked.:rolleyes:

    After I closed cmd, I didn't check to see if the new path was permanent. It was session-only, just as the variables defined in the Recovery Console are not remembered from session to session.
     
  16. 2004/03/29
    MnInShdw

    MnInShdw Inactive Thread Starter

    Joined:
    2002/07/12
    Messages:
    92
    Likes Received:
    0
    First of all I have to thank all of those who replied with their solutions. I added the path to my application by editing the environmental variables in some PCs and used the registry trick which Angle71 suggested in some others. Now from each PC in my local Network I am able to access the programs I need to control the traffic of the network only by typing MyApp in start/run dialog box.

    I learned a lot and appreciate all of you who came to my rescue.

    My best regards to all.
     
  17. 2004/03/29
    MnInShdw

    MnInShdw Inactive Thread Starter

    Joined:
    2002/07/12
    Messages:
    92
    Likes Received:
    0
    To TonyT:
    I would be appreciated if you can explain how can I do it.


    Thanks in advance

    MnInShdw
     
  18. 2004/03/29
    ackerberg

    ackerberg Inactive

    Joined:
    2002/02/02
    Messages:
    869
    Likes Received:
    2
    Thanks Zander

    OK, I finally understand what you are getting at by only typing in the name that is on a path to execute the program. But certainly browsing for a program is a lot easier than typing in a long complicated string to execute it if it is not on the path. I think we have beaten this subject to a pulp. QED!
     
  19. 2004/03/29
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    MnInShdw - From your Help & Support, Shortcut keys
     
  20. 2004/03/29
    noahdfear

    noahdfear Inactive

    Joined:
    2003/04/06
    Messages:
    12,178
    Likes Received:
    15
    Using XP Home, and just wanted to clarify something. I created a shortcut to a program within the same folder the program's .exe was in, assigned shortcut keys and it would not run. Moved the shortcut and it ran as it should. Don't know if that's normal or not.
     
  21. 2004/03/29
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    If you create a shortcut key, the shortcut itself has to be located either in the start menu somewhere or on the desktop. If the shortcut is located anywhere else the shortcut key for it won't work. This is normal.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.