Search code examples
google-chromebatch-filequotes

Quotes not working in batch script


Extremely simple script that will not function:

@echo off
Start /max "C:\Program Files\Google\Chrome\Application\chrome.exe"

It works fine with applications that contain no spaces in the url, but for some reason it won't work when there are spaces, with or without the quotes. Using Windows 7 Professional 32 bit, if that helps.


Solution

  • START has very odd syntax: Normally, the window title is optional. But the first argument not starting with / is treated as the window title if it is quoted. So if you must quote your program, then you must provide a quoted window title as the first argument. It is OK to use an empty title:

    start "" /max "C:\Program Files\Google\Chrome\Application\chrome.exe"