Dim RegObj, RegKey
Set RegObj = CreateObject("WScript.Shell")
RegKey = RegObj.RegRead("HKCU\Software\Microsoft\Windows\Cu rrentVersion\Policies\System\DisableTaskMgr")
If RegKey = "" Then MsgBox "There is no registry value for this key!"
Else
MsgBox "Registry key value is " & RegKey & "!"
Set RegObj = Nothing
End If
End
========================
didn't you see this heman85? that is for reading. it states "REGREAD". I think you did not bothered studying it. or you can use the getsettings.
are you in difficulty analyzing it?
let me state it:
1. the first line of the code states that you are setting variable RegObj and RegKey
2. second line states that you are setting the value of RegObj to a created object thru wscript.shell
3. third line states that the value of RegKey is RegObj.RegRead.
RegRead means Read registry
the value of RegObj now that is specified here is "HKCU\Software \Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr" enclosed in parenthesis because this is your wscript.
This is the path of the registry key: "HKCU\Software \Microsoft\Windows\CurrentVersion\Policies\System\
This is the registry key: DisableTaskMgr (regardless what type of entry is this)
4. the fourth line states that if regkey is empty then you have that message
5. fifth line is ELSE part of coding
6. Sixth line states that if regkey has value that and message box will appear stating your regkey value.
7. seventh line states to clear memory
8. eight line state end of IF statement
9. ninth line states the end of that code.
Moreover, if that code has error, it is because the code did not see that registry "DisableTaskMgr". So you can add DIM regkey1
Regkey1=nz(regkey,"")
the above regkey1 states that if regkey is not found of empty then, empty)
Do you further questions?
I would like to reiterate to be careful messing around the registry not to delete other key other than you created.