Hello,
I replied to your original thread, but apparently it didn't propogate to the
nntp server for some reason ...
Programs that don't prompt (like cscript in this case) receive a filtered
version of the user's administrator token, which in effect gives that
program only standard user rights. I believe this is what is causing your
errors.
You need to start cscript with admin power. To do this, open a command
prompt that you have run-as-administrator'd, and then run cscript with the
propper arguments to start your script. This will cause cscript to run with
the full administrator token, and it should work correctly.
More info on UAC:
http://technet2.microsoft.com/WindowsVista/en/library/0d75f774-8514-4c9e-ac08-4c21f5c6c2d91033.mspx
http://technet.microsoft.com/en-us/windowsvista/aa905108.aspx
http://blogs.msdn.com/uac/
Here's my original message:
Hello,
This is due to the new security feature of Windows Vista that Tom referred
to (UAC).
He explained how to turn it off, but he didn't explain what it does, what
benefits it gives you, or how to do what you were trying to do with UAC
turned on
.
Quick solution: Right-click command prompt, click run as administrator, then
start your vbs script, and it will work fine.
Now on to the explanation of what's going on ...
Very simply, UAC draws a line on your computer between administrative
programs and non-administrative programs.
UAC then enforces a single rule: Programs must have your permission in order
to have administrative power.
This gives you the following benefits:
- Programs that don't need admin power, don't have it (why give someone the
keys to your car if they will never drive it)
- Any program that wants full control over your computer must ask you for
permission, or you must explicitly start it with admin power by
right-clicking it and clicking Run As Administrator
Specifically, this protects you from programs that:
- Would try to perform administrative operations without your knowledge or
consent
- Would try to be sneaky and start an administrative program without your
knowledge/consent to bypass restrictions ("Hey I didn't start format.exe, I
don't want it to run!")
- Would try to abuse/exploit a currently running administrative program in
order to take control over your computer
So, here's how to successfully use Vista when logged in as an administrator
with UAC turned on:
Just remember that if you are starting a program or performing an action and
it doesn't prompt, then it will not have administrative control over your
computer.
- When running command-line programs: You will need to run administrative
command-line programs from an administrative command prompt (right-click
command prompt and click Run As Administrator)
- When running a Vista-compatible program: You don't have to do anything
special, these programs will prompt you automatically if they want admin
access to your computer
- When running old programs not designed for Vista: If these programs needs
admin access to your computer, right-click them and click Run As
Administrator. If you use it a lot, right-click the program, click
properties, click compatability, and put a check next to always run as
administrator. This will cause the program to automatically prompt every
time it is run.
Turning off UAC takes this extra control away from you and makes things work
like Windows XP, where any program that happens to run on your computer can
do anything it wants to your computer.
Also, turning off UAC disables Internet Explorer protected mode, because it
uses UAC's seperation-of-privilege in order to work.
--
- JB
Microsoft MVP - Windows Shell/User
Windows Vista Support Faq
http://www.jimmah.com/vista/