如果无法使用命令提示符创建管理员来重置组策略。
- 将下面的脚本复制到记事本中,然后将其保存为{文件名} .vbs
- 运行脚本。
这应该重置所有应用的GPO
If WScript.Arguments.Count = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1
Else
set winsh = CreateObject("WScript.Shell")
set winenv = winsh.Environment("Process")
windir = winenv("WinDir")
strPath = (WinDir & "\System32\GroupPolicy")
DeleteFolder strPath
Function DeleteFolder(strFolderPath)
Dim objFSO, objFolder
Set objFSO = CreateObject ("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolderPath) Then
objFSO.DeleteFolder strFolderPath, True
End If
Set objFSO = Nothing
End Function
strPath = (WinDir & "\System32\GroupPolicyUsers")
DeleteFolder strPath
Function DeleteFolder(strFolderPath)
Dim objFSO, objFolder
Set objFSO = CreateObject ("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolderPath) Then
objFSO.DeleteFolder strFolderPath, True
End If
Set objFSO = Nothing
End Function
winsh.Run "gpupdate /force", 0
End If
另请参阅如何重置本地组策略