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:
    program.exe

    console commands entered:
    cd c:\bla\bla
    c:\bla\bla\neuk.bat

    "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" ? ;)

    Bye,
    Skybuck.
     
    Skybuck Flying, Jan 20, 2008
    #1
    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.

    RC
    --
    R. C. White, CPA
    San Marcos, TX

    Microsoft Windows MVP
    (Running Windows Live Mail 2008 in Vista Ultimate x64)

    "Skybuck Flying" <> wrote in message
    news:40c$47930f4e$541983fa$1.nb.home.nl...
    > Hello.
    >
    > file contents neuk.bat:
    > program.exe
    >
    > console commands entered:
    > cd c:\bla\bla
    > c:\bla\bla\neuk.bat
    >
    > "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" ? ;)
    >
    > Bye,
    > Skybuck.
     
    R. C. White, Jan 20, 2008
    #2
    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.
    http://msmvps.com/xperts64
    http://mvp.support.microsoft.com/profile/charlie.russel


    "Skybuck Flying" <> wrote in message
    news:40c$47930f4e$541983fa$1.nb.home.nl...
    > Hello.
    >
    > file contents neuk.bat:
    > program.exe
    >
    > console commands entered:
    > cd c:\bla\bla
    > c:\bla\bla\neuk.bat
    >
    > "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" ? ;)
    >
    > Bye,
    > Skybuck.
    >
     
    Charlie Russel - MVP, Jan 20, 2008
    #3
  4. Nope just X64 Pro.

    Bye,
    Skybuck.
     
    Skybuck Flying, Jan 20, 2008
    #4
  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.

    Bye,
    Skybuck.
     
    Skybuck Flying, Jan 20, 2008
    #5
  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
    directory?

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


    "Charlie Russel - MVP" <> wrote in message
    news:...
    > 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.
    > http://msmvps.com/xperts64
    > http://mvp.support.microsoft.com/profile/charlie.russel
    >
    >
    > "Skybuck Flying" <> wrote in message
    > news:40c$47930f4e$541983fa$1.nb.home.nl...
    >> Hello.
    >>
    >> file contents neuk.bat:
    >> program.exe
    >>
    >> console commands entered:
    >> cd c:\bla\bla
    >> c:\bla\bla\neuk.bat
    >>
    >> "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" ? ;)
    >>
    >> Bye,
    >> Skybuck.
    >>

    >
     
    Tony Sperling, Jan 20, 2008
    #6
  7. I'm not seeing anything different than I'd expect with piping and
    redirection.

    --
    Charlie.
    http://msmvps.com/xperts64
    http://mvp.support.microsoft.com/profile/charlie.russel


    "Skybuck Flying" <> wrote in message
    news:e070a$4793acff$541983fa$1.nb.home.nl...
    > 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.
    >
    > Bye,
    > Skybuck.
    >
     
    Charlie Russel - MVP, Jan 20, 2008
    #7
  8. Skybuck Flying

    crich243

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

    @echo off
    Title Games - Select Your Game
    echo ============Select Your Game============
    echo.
    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)
    echo.
    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
    :MC
    cd C:\Users\Andrew\Documents\Games\Minecraft.exe
    Start Minecraft.exe
    :FSX
    cd C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\fsx.exe
    Start fsx.exe
    :AoE
    cd C:\Program Files\Microsoft Games\Age of Empires III\age3.exe
    Start age3.exe
    :SS2008
    cd C:\Program Files\Vstep\ShipSim2008\ShipSim2008.exe
    Start ShipSim2008.exe
    :KSP
    cd C:\Program Files\KSP\KSP.exe
    Start KSP.exe

    Please Help,
    crich243
     
    crich243, Jul 11, 2012
    #8
    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.