# Solved: Problem running windows app from batch file



## mstyers (Jun 10, 2004)

Running XP SP2.

I am having trouble running a window application with spaces from a batch file. Here is my command

START filename.exe /separate

This will run the application correctly.

START "file name.exe" /separate

This will open a new command window with a dos prompt.

Does anyone have any suggestions?

Thanks.


----------



## ryanclemson (Aug 6, 2007)

try using the full path of the program, i.e.

"c:\program files\file name.exe /separate"

is this a program you wrote? i didn't know windows executables could contain spaces. could you rename it to "filename.exe" ?


----------



## mstyers (Jun 10, 2004)

I tried using the full path and filename in double quotes and get the same result. I also tried it taking the /separate outside of the quotes and same result.

It seems like the start command treats the double quotes differently somehow.

The filename with spaces is a program from Verizion. I have removed the spaces to be able to make the this work but when the Verizon updates their files the file is no longer valid. That's why I'm trying to find some way for this to work in the batch process.


----------



## mstyers (Jun 10, 2004)

Looks like there is no way to run a 32bit GUI program from a batch file unless the filename is 8.3 compatible. So filenames with a space within double quotes will not work.

The only way to do this is to use the 8.3 compatible filename that is generated for filenames with periods, characters and spaces in them. These filenames are generated with the first 6 valid characters of the filename (without periods, characters or spaces) and then adds a tilde (~) and a number (1 for the first found, 2 for the second, etc.) and then the first 3 valid characters of the extension.

Example all these filenames in a single directory would be as follows:
file name.exe -> filena~1.exe
file.name.exe -> filena~2.exe
file-name.exe -> filena~3.exe

So, I was able to solve the problem above with the following command:
START filena~1.exe /separate


----------



## Squashman (Apr 4, 2003)

Why are you using /separate?

This works just fine for me.


```
start "" "C:\Id server\id server.exe"
```
You need the extra quotes. Otherwise it thinks it is the Title of the Window.


----------

