Registry Permissions & Win APIs
- From: "Travis T" <ttmessage-forum@xxxxxxxxx>
- Date: Wed, 6 Dec 2006 15:51:15 -0700
Hello all,
First of all, I'd like to apologize if this has been asked before. I
searched the group several times and to my dis-belief my mail reader did not
come up with results. I find this to be very suspicious. Anyway, below are
my questions.
I'd like to modify registry key permissions with VBS and I would like to do
it by using the Win APIs.
I have a key under HKEY_LOCAL_MACHINE that I want to give full rights to
Administrators and System. I want to give read rights to power users and I
want to revoke all other rights for all other users.
I've done VB, but am new to VBS so please do not ostercize me for this noob
question. I have found how to do this in VB using the RegSetKeySecurity
function in advapi32.dll. However, I can't even open a key in VBS using
RegOpenKey because I receive a VBScript compilation error on the declaring
function saying "Expected Identifier"
[code]
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA"
(ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
[/code]
Also, in setting up some constants, I get a compilation error of "Expected
Literal Constant"
[code]
Private Const KEY_SET_VALUE = &H2
Private Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or
KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
[/code]
Is it possible to directly use the Windows APIs from VB Script? If it is
possible, what do I need to do to make this work?
If it isn't possible, then what can I do that will work on Win 2k, XP Pro,
and 2003 to change the security permissions on a registry key?
Thank you,
Travis
.
- Follow-Ups:
- Re: Registry Permissions & Win APIs
- From: alex
- Re: Registry Permissions & Win APIs
- Prev by Date: Re: Delete User
- Next by Date: Re: HTML Tabs
- Previous by thread: HTML Tabs
- Next by thread: Re: Registry Permissions & Win APIs
- Index(es):
Relevant Pages
|