1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Problem running windows app from batch file

Discussion in 'DOS/Other' started by mstyers, Sep 21, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. mstyers

    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.
     
  2. ryanclemson

    ryanclemson

    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" ?
     
  3. mstyers

    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.
     
  4. mstyers

    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
     
  5. Squashman

    Squashman 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.
     
  6. Sponsor

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 733,556 other people just like you!

Loading...
Similar Threads - Solved Problem running
  1. Comprobs281
    Replies:
    1
    Views:
    415
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/752014

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice