Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kafkaesqu3/ea049e7c892ce13d27d67713b75c8e34 to your computer and use it in GitHub Desktop.
Save kafkaesqu3/ea049e7c892ce13d27d67713b75c8e34 to your computer and use it in GitHub Desktop.
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objReg = objLocator.ConnectServer(strComputer, "root\cimv2").Get("StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubKeys
objReg.GetDWORDValue HKLM, strkey, "ProcessCreationIncludeCmdLine_Enabled", isenabled
If IsNull(isenabled) Then
retval = "Not Enabled"
Else
If isenabled > 0 Then
retval = "Enabled!"
Else
retval = "Not Enabled"
End If
End If
wscript.echo retval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment