0

A VBScript cannot edit the registry by default on Vista. How do I get elevation (even if the user has to do something when they run the script) so that the script can edit the registry?

The error is:

---------------------------
Windows Script Host
---------------------------
Script: blah blah blah.vbs
Line:   6
Char:   1
Error:  Permission denied
Code:   800A0046
Source:     Microsoft VBScript runtime error

---------------------------
OK   
---------------------------
4

3 回答 3

1

My understanding was that you could edit HKCU as a normal user, but the others were restricted. I could be wrong. Regardless, there are a couple of example here to do what you want to do.

于 2008-10-30T14:29:51.533 回答
0

To make it work with native VBScript, you will most likely need a code signing certificate and sign your script with that. More info is in that thread at tek-tips.com.

You could try to write the intended changes to a .reg file and call regedit.exe with that. Maybe this triggers UAC. Did not tried that, though. I have no Vista around right now. :-)

于 2008-10-30T14:29:46.120 回答
0

Windows XP had the capability to "Run As..." when you right-clicked a program (like the shortcut to the command line). Doesn't Vista have something like this, "Run as Administrator" or something.

Do this on the command line then have them run the script from the command line?

于 2008-10-30T14:32:44.227 回答