Program launch
See start /? and call /? for help in all three areas.
Enter a program name
c:\windows\notepad.exe
In a batch file, the party will wait for the program to exit. when I typed the command line, it does not wait for the graphical program to exit.
If the program is managed by a batch file and the rest of the calling batch file is not executed.
Use the start command
start "" c:\windows\notepad.exe
Start starts the program and does not wait. Console programs are launched in a new window. Using / b switches the console programs to the same window, which negates the main purpose of Start.
At the beginning, the graphical shell of Windows is used - the same as the input in WinKey + R (start dialog). Try
start shell:cache
Also note that the first set of quotes, if any, MUST be the window title.
Use call command
A call is used to run batch files and wait for them to exit and continue the current batch file.
With a link to Start and just enter the name of the program.
Windows Help Searching for programs and documents
Programs and documents can be added to the registry, so entering their name without their path in the Start - Run dialog box or a shortcut allows Windows to find them.
REGEDIT4 ;The bolded name below is the name of the document or program, <filename>.<file extension> [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IE.txt] ;The @ means the path to the file is assigned to the default value for the key. ;The whole path in enclosed in a quotation mark ". @="\"C:\\Program Files\\Internet Explorer\\IE.txt\"" ;Optional Parameters. The semicolon means don't process the line. Remove it if you want to put it in the registry ;Informs the shell that the program accepts URLs. ;"useURL"="1" ;Sets the path that a program will use as its' default directory. This is commented out. ;"Path"="C:\\Program Files\\Microsoft Office\\Office\\"
For technical discussion.
CMD preprocesses the commands and finds the file, and then calls CreateProcess . The Start - Run dialog or the Start command uses ShellExecuteEx , which ultimately calls CreateProcess .
These are the rules of CreateProcess β the CMD note provides the full paths to CreateProcess . https://msdn.microsoft.com/en-us/library/ms682425
1. The directory from which the application was downloaded.
2. The current directory for the parent process.
3. 32-bit Windows system directory. Use the GetSystemDirectory function to get the path to this directory.
- Windows 16-bit system catalog. There is no function that gets the path to this directory, but a search is performed. The name of this directory is System.
5. Windows directory. Use the GetWindowsDirectory function to get the path to this directory.
6. Directories listed in the PATH environment variable. Please note that this function does not look for the path to each application specified in the application registry key. To include this path for each application in the search sequence, use the ShellExecute function.
ShellExecuteEx here https://msdn.microsoft.com/en-us/library/bb759784(v=vs.85).aspx
CMD preprocessing is available on my Skydrive - initially on the MS website, but no more. See Windows NT Ch 2 Command Shell https://1drv.ms/f/s!AvqkaKIXzvDieQFjUcKneSZhDjw