A .bat
script that launches a program stopped working today on Windows 10 Pro 21H1.
Investigating, the batch file contains start "" "%~dp0winnfsd" -log %2 -pathFile %3 -id %4 %5
which filled in is:
start "" "C:\Users\Peter\.vagrant.d\gems\2.6.7\gems\vagrant-winnfsd-1.4.0\bin\winnfsd" -log on -pathFile "C:/Users/Peter/.vagrant.d/nfspaths" -id 0 0
When this is executed from a batch file or command prompt, today it gives the error:
The filename, directory name, or volume label syntax is incorrect.
Press Enter or Esc to exit...
If I remove start ""
and run the command from the command prompt it works:
"C:\Users\Peter\.vagrant.d\gems\2.6.7\gems\vagrant-winnfsd-1.4.0\bin\winnfsd" -log on -pathFile "C:/Users/Peter/.vagrant.d/nfspaths" -id 0 0
And after reading https://stackoverflow.com/a/8351295/119750 I modified the batch file to contain this and it works:
start cmd /c call "C:\Users\Peter\.vagrant.d\gems\2.6.7\gems\vagrant-winnfsd-1.4.0\bin\winnfsd.exe" -log on -pathFile "C:/Users/Peter/.vagrant.d/nfspaths" -id 0 0
I don't understand what's going on here or why the first has stopped working.
- Why would the first command not work/stop working?
- Why does calling
cmd
make a difference?