Search code examples
batch-filedos

Windows batch file "start" command is not opening complete URL


I am creating a batch file in windows with the following command in it.

start https://abcd.com/command?username=user&password=pass&mode=desktop

I am expecting this to open default browser with this URL when running it. It does open the default browser, but the URL that was opened in the browser is actually truncated.

https://abcd.com/command?username=user

What should I give in the URL to make it posted completely?


Solution

  • & is a special character in batch scripting. Just quote the URL and pass an empty string as the title:

    start "" "https://abcd.com/command?username=user&password=pass&mode=desktop"