'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 2009
'
' NAME:
'
' AUTHOR: duh ,
' DATE : 8/13/2009
'
' COMMENT:
'
'==========================================================================
Dim oShell : Set oShell = CreateObject("WScript.Shell")
Dim sDisableUAC : sDisableUAC = "%windir%\System32\cmd.exe /k %windir%\System32\reg.exe"&_
" ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"&_
" /v EnableLUA /t REG_DWORD /d 0 /f"
Dim sSupressElevationWrn : sSupressElevationWrn = "%windir%\System32\cmd.exe /k %windir%\System32\reg.exe"&_
" ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\"&_
"CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin"&_
" /t REG_DWORD /d 0 /f"
Dim sEnableUAC : sEnableUAC = "%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD "&_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System "&_
"/v EnableLUA /t REG_DWORD /d 1 /f"
Dim sEnableElevationWrn : sEnableElevationWrn = "%windir%\System32\cmd.exe /k %windir%\System32\reg.exe "&_
"ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"&_
" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f"
If WScript.Arguments.Count < 2 Then
Display_Help ()
Else
Run_Script ()
End If
Sub Display_Help ()
WScript.Echo "*******************************************"
WScript.Echo "* Win7UAC Usage *"
WScript.Echo "*Win7UAC {UAC setting} {Elvation Consents}*"
WScript.Echo "*ie Win7UAC /Disable /Supress *"
WScript.Echo "*******************************************"
WScript.Echo "/? --Displays Usage"
WScript.Echo "/Disable --Disables UAC"
WScript.echo "/Enable -- Enables the UAC"
WScript.Echo "/Supress -- Supresses the Elvation Consent Messages"
WScript.Echo "/Elevate -- Re-Enables Elevation Consent Messages"
End Sub
Sub Run_Script ()
Dim sArg1 : sArg1 = LCase(Replace(wscript.Arguments.Item(0),"/",""))
Dim sArg2 : sArg2 = LCase(Replace(wscript.Arguments.Item(1),"/",""))
'Handle UAC
'=============================================================================================
If sArg1 = "disable" Then
oShell.Exec sDisableUAC
Else If sArg1 = "enable" Then
oShell.Exec sEnableUAC
End If
End If
'=============================================================================================
'Hanlde Elevation Supression
'=============================================================================================
If sArg2 = "supress" Then
oShell.Exec sSupressElevationWrn
Else If sArg2 = "elevate" Then
oShell.Exec sEnableElevationWrn
End If
End If
'=============================================================================================
End Sub
'oShell.Exec sDisableUAC
'oShell.Exec sSupressElevationWrn
|