Command line Help

Status
Not open for further replies.

drappendix

Posts: 13   +0
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.
 
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"
 
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?
 
Did I mention "start" anywhere? You use
Code:
"c:\program files\program\program.exe"
 
Status
Not open for further replies.
Back