Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > scripts

Reply
 
 
Juan
Guest
Posts: n/a

 
      09-18-2007
Good day
I am running windows vista on a domain and I realised that my scripts are
not executing because of a error
My vbs script it adds directories and settings to the machine this script
sometimes uses shell dos command but it gets the error on access denied

How can I give access to the vbs to run under administrator rights because
it works if I run it under administrator?
This script was working under windows xp perfectly in the past


--
Juan Bredenkamp


 
Reply With Quote
 
 
 
 
Rick Rogers
Guest
Posts: n/a

 
      09-18-2007
Hi Juan,

If it's making changes to protected system files then it cannot run without
elevated privileges. This is a design change to prevent malicious software
from making system changes without the user's knowledge.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"Juan" <> wrote in message
newsB775B80-C522-43BB-B2CE-...
> Good day
> I am running windows vista on a domain and I realised that my scripts are
> not executing because of a error
> My vbs script it adds directories and settings to the machine this script
> sometimes uses shell dos command but it gets the error on access denied
>
> How can I give access to the vbs to run under administrator rights because
> it works if I run it under administrator?
> This script was working under windows xp perfectly in the past
>
>
> --
> Juan Bredenkamp
>
>


 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      09-18-2007
"Juan" <> wrote...
> My vbs script it adds directories and settings to the machine this script
> sometimes uses shell dos command but it gets the error on access denied
> How can I give access to the vbs to run under administrator rights because
> it works if I run it under administrator?


Hi Juan,

If your script is performing actions which require Administrative consent,
there is no way to avoid this in Vista (short of disabling UAC, which is
*not* recommended).

But, you can make your scripts *request* consent, rather than just fail with
"access denied". In VBScript, the way to do this is to use the ShellExecute
method of Shell.Application, to run a "RUNAS" command. This provides a
wrapper for your original vbs script, so that it will run as the
administrator and request elevation to a full administrative token.
Basically, it's adding about 10 extra lines of code to your script.

For more background information, check out these pages:
http://www.winhelponline.com/articles/185/1/
http://www.microsoft.com/technet/tec...t/default.aspx
There are probably several other good links out there as well, which you can
find with Google etc.

Hope this helps, good luck with it!
--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
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

BB 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
UAC and scripts sputnik Windows Vista Installation 2 05-09-2008 08:31 AM
Scripts Zoie Windows Vista Mail 6 03-09-2008 11:05 AM
UAC and scripts MJ Windows Vista General Discussion 0 08-02-2007 08:22 PM
UAC and scripts (.wsf) Thomas Boerkel Windows Vista Security 1 11-07-2006 01:53 PM
More Login Scripts john Windows Vista General Discussion 0 09-13-2006 08:07 PM



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