executing batch file from different folder not working ?

Discussion in 'Windows 64bit' started by Skybuck Flying, Jan 20, 2008.

  1. Hello.

    file contents neuk.bat:

    console commands entered:
    cd c:\bla\bla

    "can't execute program.exe" it says.

    This seems abnormal from ms-dos 6.22 days ?

    The batch file is supposed to execute the program.exe no matter from what
    folder the batch file is invoked ?

    Seems to be a bug ????

    Or is this a new "security feature" ? ;)

    Skybuck Flying, Jan 20, 2008
    1. Advertisements

  2. Skybuck Flying

    R. C. White Guest

    Hi, Skybuck.

    Are you running Vista? Are you THE Administrator? Does Vista know this?

    Open an Administrator:Command Prompt. (Right-click cmd.exe, then Run as
    Administrator.) Run your batch file in this window.

    Yes, this is a new security feature. Vista doesn't like to run .exe files
    without proof that the Administrator is in control.

    R. C. White, CPA
    San Marcos, TX

    Microsoft Windows MVP
    (Running Windows Live Mail 2008 in Vista Ultimate x64)
    R. C. White, Jan 20, 2008
    1. Advertisements

  3. If the program.exe you're calling requires elevation, this will fail. If it
    does NOT require elevation, it will work. And in all cases if you open an
    elevated command shell, it will work.
    Charlie Russel - MVP, Jan 20, 2008
  4. Nope just X64 Pro.

    Skybuck Flying, Jan 20, 2008
  5. Nope, that's not the problem.

    I have figured out what the problem is, it seems to be a bug with the > pipe
    direction in x64.

    I'll post a new thread to describe the problem.

    Skybuck Flying, Jan 20, 2008
  6. This is probably wrong, this is old stuff for me, but does not excution from
    batch files require the full pathname to the *.EXE if it is not guaranteed
    to be in the current directory - or further down the tree from the current

    I seem to remember there was always some kind of inconsistency that tought
    me to always write them that way, way back when.

    Anyway, what is the current directory? Is "C:\bla\bla" the batchfile home or
    just anywhere?

    'Piping', wasn't mentioned in the example code, but that could complicate
    matters, I'm sure.

    Tony. . .
    Tony Sperling, Jan 20, 2008
  7. I'm not seeing anything different than I'd expect with piping and
    Charlie Russel - MVP, Jan 20, 2008
  8. Skybuck Flying


    Jul 11, 2012
    Likes Received:
    Hey All,
    can someone tell me why this isn't working.

    @echo off
    Title Games - Select Your Game
    echo ============Select Your Game============
    echo 1 = Minecraft (MC)
    echo 2 = Flight Simulator X (FSX)
    echo 3 = Age of Empires 3 (AoE 3)
    echo 4 = Ship Simulator 2008 (SS2008)
    echo 5 = Kerbal Space Program (KSP)
    SET /P Choose=Type the Number Next to your Chosen Game then Press ENTER:
    IF %Choose%==1 GOTO MC
    IF %Choose%==2 GOTO FSX
    IF %Choose%==3 GOTO AoE
    IF %Choose%==4 GOTO SS2008
    IF %Choose%==5 GOTO KSP
    cd C:\Users\Andrew\Documents\Games\Minecraft.exe
    Start Minecraft.exe
    cd C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\fsx.exe
    Start fsx.exe
    cd C:\Program Files\Microsoft Games\Age of Empires III\age3.exe
    Start age3.exe
    cd C:\Program Files\Vstep\ShipSim2008\ShipSim2008.exe
    Start ShipSim2008.exe
    cd C:\Program Files\KSP\KSP.exe
    Start KSP.exe

    Please Help,
    crich243, Jul 11, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.