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.

Batch file conundrum

Discussion in 'Windows 7' started by sprinke, Dec 30, 2010.

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

    sprinke Thread Starter

    Joined:
    Dec 30, 2010
    Messages:
    2
    Hello all. I am trying to write a very simple batch file that launches a program. I am very much a novice at this but I'm able to piece things together from information online.

    My script so far is simple:

    Code:
    @echo off
    
    start "C:\Program Files\blah directory\blah.exe"
    Now here's where it gets tricky. The program in question is designed to run only when the CD is in the drive. I made an .iso copy of the CD and mounted the iso using Virtual CloneDrive. No problems there. When I double-click on blah.exe from Windows Explorer, the program launches just fine. BUT, when I run my batch file, it complains about the CD not being in the drive.

    Shouldn't they be doing the exact same thing? Why does clicking to run the program work, while the batch file fail? Is there something I can do with environment variables that might help?
     
  2. Gizmoto

    Gizmoto

    Joined:
    Dec 31, 2010
    Messages:
    232
    tell the batch file to open the iso (if it can ) insted of the CD , or have the iso mounted then have the batch file run the Blah.exe from the Iso.
     
  3. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Maybe the batch is not running because of the security context. I am not sure batch files run by default in WIndows 7 without running as admin.
     
  4. Giglamesch

    Giglamesch

    Joined:
    Jun 7, 2010
    Messages:
    36
    I had the same problem and i sorted it out by making a shortcut to an easier destination for instance:

    @echo off
    start c:\blah\blah.ink

    and that worked fine
     
  5. sprinke

    sprinke Thread Starter

    Joined:
    Dec 30, 2010
    Messages:
    2
    I found that if I used a slightly different syntax, it worked just fine:

    Code:
    start /d "C:\Program Files\blah directory\" blah.exe
    I guess maybe it needed to be inside the directory before trying to run the exe?

    Thanks everyone who tried to help.
     
  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...
Thread Status:
Not open for further replies.

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

  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