Solved: Problem running windows app from batch file

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mstyers

Thread Starter
Joined
Jun 10, 2004
Messages
71
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.
 
Joined
Aug 6, 2007
Messages
87
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

Thread Starter
Joined
Jun 10, 2004
Messages
71
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

Thread Starter
Joined
Jun 10, 2004
Messages
71
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

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
Why are you using /separate?

This works just fine for me.

Code:
start "" "C:\Id server\id server.exe"
You need the extra quotes. Otherwise it thinks it is the Title of the Window.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Members online

Top