Re: Vista: Batch file cannot find path of exe
On Apr 11, 6:30 pm, "Bruce" <bruce.james....@gmail.com> wrote:
> Hi Michael
> If i code the full path of the exe file, it works. But I don't want to
> do that since I am not sure where users will copy it to.
> I checked the permissions for .bat and .exe file, both are not read-
> only, not hidden.
> On Apr 11, 5:05 pm, "Michael Chare" <MunderscoreN...@chareDOTorg.uk>
> > "Bruce" <bruce.james....@gmail.com> wrote in message
> >news:firstname.lastname@example.org oups.com...
> > > Hi
> > > I just posted this but it has not come up in the groups even after 3
> > > hours. so resposting..
> > > I have a silly question on vista. I have a .bat file calling an .exe
> > > file both in the same directory in vista, but every time i right click
> > > the .bat file and ask it to "run as administrator", it fails to find
> > > the .exe file. it says "blah.exe is not a recognized program"
> > > but the same batch file works fine if UAC is disabled and in XP.
> > > any idea why? should i modify something in the batch file which
> > > currently reads as
> > > "blah.exe <params>"
> > > Thanks
> > > Bruce
> > Maybe code the full path for the .exe file. Also check file permissions
> > (Attributes).
> > --
> > Michael Chare- Hide quoted text -
> > - Show quoted text -
I managed to resolve the problem! When Vista runs a batch file as
admin, it runs it from the system32 directory - that is why it could
not find the exe.
The solution was to move to the current directory at the start of the