Skip to content

cmd /c start truncates your URL at the first &

args quoting · case

bothsilentscriptagentfirst-partyrepro: verifiedcmd-reparse
Affectscmd, windows
Fails assilent
Mechanismcmd reparse
Safe fixcaret escape cmd

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 command

cmd.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.

  • 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.