Jump to content

executing batch file from different folder not working ?


Recommended Posts

Guest Skybuck Flying
Posted

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.

  • Replies 6
  • Created
  • Last Reply

Popular Days

Guest R. C. White
Posted

Re: executing batch file from different folder not working ?

 

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

rc@grandecom.net

Microsoft Windows MVP

(Running Windows Live Mail 2008 in Vista Ultimate x64)

 

"Skybuck Flying" <spam@hotmail.com> wrote in message

news:40c$47930f4e$541983fa$14059@cache5.tilbu1.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.

Guest Charlie Russel - MVP
Posted

Re: executing batch file from different folder not working ?

 

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" <spam@hotmail.com> wrote in message

news:40c$47930f4e$541983fa$14059@cache5.tilbu1.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.

>

Guest Skybuck Flying
Posted

Re: executing batch file from different folder not working ?

 

Nope just X64 Pro.

 

Bye,

Skybuck.

Guest Skybuck Flying
Posted

Re: executing batch file from different folder not working ?

 

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.

Guest Tony Sperling
Posted

Re: executing batch file from different folder not working ?

 

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" <charlie@mvKILLALLSPAMMERSps.org> wrote in message

news:FD7D8B55-5E00-4FEF-9AE1-B505BC78FE19@microsoft.com...

> 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" <spam@hotmail.com> wrote in message

> news:40c$47930f4e$541983fa$14059@cache5.tilbu1.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.

>>

>

Guest Charlie Russel - MVP
Posted

Re: executing batch file from different folder not working ?

 

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" <spam@hotmail.com> wrote in message

news:e070a$4793acff$541983fa$20086@cache6.tilbu1.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.

>


×
×
  • Create New...