1

I have created a .bat script allowing me to start all programs I need to stream on twitch. However I am facing a problem with an application. I would like to start the following program: ground%20control.exe

When I type in cmd.exe:

start "" "C:\Users\xxx\AppData\Local\ground_control\Ground%20Control.exe"

It works.

When I use the exact same command in my .bat file I end up with the following error:

Impossible to find C:\Users\xxx\AppData\Local\ground_control\Ground0Control.exe

I assume that it is probably a formatting problem. Any help would be much welcomed.

Ex.O
  • 13
  • 5

1 Answers1

2

In batch files the percent symbol is used to indicate parameter, in your case it is treating %2 as a parameter and due to it being empty, replacing it with empty.

From this page Batch Files - Escape Characters

In batch files, the percent sign may be "escaped" by using a double percent sign ( %% ). That way, a single percent sign will be used as literal within the command line, instead of being further interpreted.

So change it to the following in your batch file

start "" "C:\Users\xxx\AppData\Local\ground_control\Ground%%20Control.exe"
Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54