-2

Having such super simple batch file for Win 10

@ECHO OFF
start "C:\Program Files\Mozilla Firefox\firefox.exe"

When I launch it a command window titled C:\Program Files\Mozilla Firefox\firefox.exe appears instead of just launching the firefox.

What's wrong with the script?

Mulligan
  • 669
  • 3
  • 11
  • 30
  • @John Ok, thx that worked but I'm REALLY curious WHY my solution doesn't work? – Mulligan Jun 14 '21 at 14:42
  • @John As far as I've read the `start` help `(start /?`) in the answer You've provided the string in quotes is just the window title, not a patch to program... – Mulligan Jun 14 '21 at 14:52
  • @John You're a little wrong friend, read the answer I've accepted - this i just the title for the window. – Mulligan Jun 14 '21 at 15:03

1 Answers1

1

The problem is that if the first parameter to START is a quoted string, it will assume that it is the intended title. If you need to pass a quoted string for the executable because of spaces in the pathname, put an empty string "" as the first parameter to START:

START "" "C:\Program Files\Mozilla Firefox\firefox.exe"

Editorial comment: This is stupid. If it were properly designed, start would require a switch (e.g., /T) to signal the window title.

Jeff Zeitlin
  • 4,416
  • 2
  • 16
  • 30
  • You're right, but how to se that tile thing? When i type `START "Abc" "C:\Program Files\Mozilla Firefox\firefox.exe"` there is no `Abc` in the opened window... – Mulligan Jun 14 '21 at 15:05
  • @Mulligan - It will be the title of the CMD window that's opened, not the FireFox window. If the CMD window closes immediately after Firefox is launched (which is normal for non-console programs), there won't be a window for the title to apply to. – Jeff Zeitlin Jun 14 '21 at 15:07
  • Ok, got it. Thx. – Mulligan Jun 14 '21 at 15:08