Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - scripts

Reply
 
Old 09-18-2007   #1 (permalink)
Juan


 
 

scripts

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



My System SpecsSystem Spec
Old 09-18-2007   #2 (permalink)
Rick Rogers


 
 

Re: scripts

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" <juanb@xxxxxx> wrote in message
newsB775B80-C522-43BB-B2CE-4C9DBC82FE4C@xxxxxx
Quote:

> 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
>
>
My System SpecsSystem Spec
Old 09-18-2007   #3 (permalink)
Andrew McLaren


 
 

Re: scripts

"Juan" <juanb@xxxxxx> wrote...
Quote:

> 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


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
run .cmd scripts on remote machine (automating the MOSS install via scripts) PowerShell
Sql scripts PowerShell
Scripts Vista mail
run different scripts PowerShell
UAC and scripts (.wsf) Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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