Open a command prompt window and run start /?
. This outputs the help for the command START which should be read on using this command to get knowledge about its options.
Run in command prompt window call /?
and read the output help pages to understand %~dp0
. The drive and path of the batch file (argument 0) always ends with a backslash. Therefore don't add an extra backslash on concatenating it with another string.
And the first double quoted string is interpreted by START as title for the new console window displayed in title bar of the new window. Therefore better specify always a title string which can be also an empty string like ""
in case of starting a GUI application on which no console window is opened at all.
start "Running QGIS2" /D "%~dp0DATA\QGIS2\bin" qgis.bat
Also possible is using this command line in batch file:
start "Running QGIS2" /D"%~dp0DATA\QGIS2\bin" qgis.bat
Here start in directory as defined with /D"%~dp0DATA\QGIS2\bin"
is 100% correct specified according to help of command START as one parameter string.
But Windows command interpreter accepts also the first variant with just option /D
without any folder path and next parameter string "%~dp0DATA\QGIS2\bin"
after a separating space is the folder path for start in directory.
The first variant with just /D
as one parameter string and "%~dp0DATA\QGIS2\bin"
as one more parameter string is easier to read in comparison to second variant with /D"%~dp0DATA\QGIS2\bin"
being just one parameter string.