TechSpot

Command line Help

By drappendix
Nov 17, 2006
  1. i just want to simply start programs from cmd. i dont want to have to change active directories everytime and i dont want to set a path value for each of my programs. is there a command that i can use to do this. "start" would work but it skips over the spaces in "program files" so it does not work. any suggestions. also wat commands occur when you click on a shortcut. does it change the dir and then run the command target. if it is possibl to copy that method. that could be the solution.
     
  2. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Use quotes to get around spaces in path names a la "C:\Program Files\Useless Program\crappy.exe"

    A shortcut is just a file with a .lnk extension. The contents of the file are basically what you see in a shortcut's properties: the program to run, the directory etc.

    If you are running many programs from different locations, then there are three ways to make command line easier:
    - Use the PATH environment variable. Unfortunately, after you have added a couple of locations, it become very long and cumbersome to maintain.
    - Add your programs to the App Paths registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
    See the existing subkeys for examples
    - Set up a directory that contains shortcuts to your programs and then add that directory to the PATH variable. Unfortunetely, you have to append the .lnk to every command unless you also modify the PATHEXT variable to contain ".lnk"
     
  3. drappendix

    drappendix TS Rookie Topic Starter

    correct me if im wrong if i use: start "c:\program files\program\program.exe" its just starts a new window with a title of the quote.

    Can you give an example to run the above program?
     
  4. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Did I mention "start" anywhere? You use
    Code:
    "c:\program files\program\program.exe"
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...