Option Explicit Dim WSHShell, n, p, errnum, itemtype Dim objFSO, objFile, strFileName Set WSHShell = WScript.CreateObject("WScript.Shell") p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\" p = p & "DisableRegistryTools" itemtype = "REG_DWORD" Err.Clear On Error Resume Next n = WSHShell.RegRead (p) On Error Goto 0 errnum = Err.Number if errnum <> 0 then WSHShell.RegWrite p, 0, itemtype End If If n = 1 then n = 0 WSHShell.RegWrite p, n, itemtype Set objFSO = CreateObject("Scripting.FileSystemObject") strFileName = "drt.txt" Set objFile = objFSO.CreateTextFile(strFileName) objFile.Write "" & vbCrLf & "==== Policies Found ======================" & vbCrLf & "" objFile.Write "" & vbCrLf & "DisableRegistryTools Found -> PUM - Fixed" objFile.Write "" & vbCrLf objFile.Close End If