Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Vista: Batch file cannot find path of exe

microsoft.public.windows.vista.general






Speedup My PC
Reply
  #1 (permalink)  
Old 04-11-2007
Bruce
 

Posts: n/a
Vista: Batch file cannot find path of exe
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

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-12-2007
Michael Chare
 

Posts: n/a
Re: Vista: Batch file cannot find path of exe
"Bruce" <bruce.james.lee@gmail.com> wrote in message
news:1176330405.893150.72620@e65g2000hsc.googlegro ups.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

Reply With Quote
  #3 (permalink)  
Old 04-12-2007
Bruce
 

Posts: n/a
Re: Vista: Batch file cannot find path of exe
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.

Thanks
Bruce

On Apr 11, 5:05 pm, "Michael Chare" <MunderscoreN...@chareDOTorg.uk>
wrote:
> "Bruce" <bruce.james....@gmail.com> wrote in message
>
> news:1176330405.893150.72620@e65g2000hsc.googlegro ups.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 -



Reply With Quote
  #4 (permalink)  
Old 04-12-2007
Bruce
 

Posts: n/a
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.
>
> Thanks
> Bruce
>
> On Apr 11, 5:05 pm, "Michael Chare" <MunderscoreN...@chareDOTorg.uk>
> wrote:
>
> > "Bruce" <bruce.james....@gmail.com> wrote in message

>
> >news:1176330405.893150.72620@e65g2000hsc.googlegr 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 -


Hi
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
batch file.

Thanks
Bruce

Reply With Quote
  #5 (permalink)  
Old 04-13-2007
Joe Guidera
 

Posts: n/a
Re: Vista: Batch file cannot find path of exe
I suspect that when the token elevates (e.g. when you run as administrator)
the default shell environment (e.g. the command environment) starts in
c:\windows\system32. Just for curiosity, if you create a shortcut to the
BAT file and set the "start in" on the shortcut, does it resolve the issue?

J

"Bruce" <bruce.james.lee@gmail.com> wrote in message
news:1176341404.793578.294110@p77g2000hsh.googlegr oups.com...
> 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.
>
> Thanks
> Bruce
>
> On Apr 11, 5:05 pm, "Michael Chare" <MunderscoreN...@chareDOTorg.uk>
> wrote:
>> "Bruce" <bruce.james....@gmail.com> wrote in message
>>
>> news:1176330405.893150.72620@e65g2000hsc.googlegro ups.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 -

>
>

Reply With Quote
  #6 (permalink)  
Old 09-26-2009
 

Join Date: Sep 2009
Posts: 1
VistaUser26 is on a distinguished road
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Vista: Batch file cannot find path of exe
I was having a similar problem where vista wouldn't recognize the file path of a batch file.

All I had to do to fix it was save the batch file (created with Notepad) as ANSI encoded text (save as > Encoding ANSI)

Hope it helps someone with the same problem
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Task Schedule batch file donator microsoft.public.windows.vista.general 7 03-09-2009 23:12
Vista: Batch file cannot find path of exe Bruce microsoft.public.windows.vista.general 1 12-11-2008 02:27
Fast User Switching via Command Line or Batch File? Woody45 microsoft.public.windows.vista.general 1 03-17-2007 19:52
Fast User Switching via Command Line or Batch File? Woody45 microsoft.public.windows.vista.administration accounts passwords 0 02-28-2007 14:13




All times are GMT +1. The time now is 07:19.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120