cmd /c start truncates your URL at the first &
args quoting · case
Affectscmd, windows
Fails assilent
Mechanismcmd reparse
Safe fixcaret escape cmd
Symptom
Section titled “Symptom”Opening a URL with cmd /c start opens the browser at …?a=1 — the rest of the query string vanished, and sometimes ‘b’ is not recognized as a command flashes.
cmd /c start "" https://example.com/?a=1&b=2# browser opens ...?a=1 ; cmd tries to run "b=2" as a second commandcmd.exe re-parses the command line it is handed; & is its command separator. URLs routinely contain &, so routing them through cmd /c start splits the line into two commands at the first ampersand.
Workaround
Section titled “Workaround”- Escape cmd metacharacters (& ^ | < > %) with ^ before interpolating — the referenced fix does this for browser-open.
- Better: avoid cmd — spawn rundll32 url.dll,FileProtocolHandler
or use the runtime’s opener API.