Advertisement
Guest User

update_reset.cmd

a guest
Nov 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. @echo off
  2. cls
  3. rem
  4. rem Set the title and above clear the screen,
  5. rem Then set the text color to white.
  6. rem
  7. title Windows Update Resetting Tool
  8. color 0f
  9. rem
  10. rem Stop the services so that they don't overwrite data.
  11. rem
  12. net stop wuauserv
  13. net stop bits
  14. rem
  15. rem Take ownership of these files along with granting full control,
  16. rem If there are already old files present, Remove them then,
  17. rem rename the current folders to old folders so that we can attempt to fetch again.
  18. rem
  19. takeown /f "%SystemRoot%\SoftwareDistribution" /a
  20. icacls "%SystemRoot%\SoftwareDistribution" /grant Administrators:(F)
  21. takeown /f "%SystemRoot%\system32\catroot2" /a
  22. icacls "%SystemRoot%\system32\catroot2" /grant Administrators:(F)
  23. takeown /f "%SystemRoot%\syswow64\catroot2" /a
  24. icacls "%SystemRoot%\syswow64\catroot2" /grant Administrators:(F)
  25. if exist "%SystemRoot%\softwaredistribution.old" del "%SystemRoot%\softwaredistribution.old" /q
  26. ren "%SystemRoot%\SoftwareDistribution" "SoftwareDistribution.old"
  27. if exist "%SystemRoot%\system32\catroot2.old" del "%SystemRoot%\system32\catroot2.old" /q
  28. ren "%SystemRoot%\system32\catroot2" "catroot2.old"
  29. if exist "%SystemRoot%\syswow64\catroot2.old" del "%SystemRoot%\syswow64\catroot2.old" /q
  30. ren "%SystemRoot%\syswow64\catroot2" "catroot2.old"
  31. rem
  32. rem Jump to the system32 folder.
  33. rem
  34. cd %SystemRoot%\system32
  35. rem
  36. rem Re-Register the DLLs if they are not present in registry yet.
  37. rem
  38. regsvr32 atl.dll /s
  39. regsvr32 urlmon.dll /s
  40. regsvr32 mshtml.dll /s
  41. regsvr32 shdocvw.dll /s
  42. regsvr32 browseui.dll /s
  43. regsvr32 jscript.dll /s
  44. regsvr32 vbscript.dll /s
  45. regsvr32 scrrun.dll /s
  46. regsvr32 msxml.dll /s
  47. regsvr32 msxml3.dll /s
  48. regsvr32 msxml6.dll /s
  49. regsvr32 actxprxy.dll /s
  50. regsvr32 softpub.dll /s
  51. regsvr32 wintrust.dll /s
  52. regsvr32 dssenh.dll /s
  53. regsvr32 rsaenh.dll /s
  54. regsvr32 gpkcsp.dll /s
  55. regsvr32 sccbase.dll /s
  56. regsvr32 slbcsp.dll /s
  57. regsvr32 cryptdlg.dll /s
  58. regsvr32 oleaut32.dll /s
  59. regsvr32 ole32.dll /s
  60. regsvr32 shell32.dll /s
  61. regsvr32 initpki.dll /s
  62. regsvr32 wuapi.dll /s
  63. regsvr32 wuaueng.dll /s
  64. regsvr32 wuaueng1.dll /s
  65. regsvr32 wucltui.dll /s
  66. regsvr32 wups.dll /s
  67. regsvr32 wups2.dll /s
  68. regsvr32 wuweb.dll /s
  69. regsvr32 qmgr.dll /s
  70. regsvr32 qmgrprxy.dll /s
  71. regsvr32 wucltux.dll /s
  72. regsvr32 muweb.dll /s
  73. regsvr32 wuwebv.dll /s
  74. rem
  75. rem Jump to windows directory.
  76. rem
  77. cd %SystemRoot%
  78. rem
  79. rem Reset the permission presets for both services.
  80. rem
  81. sc sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
  82. sc sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
  83. rem
  84. rem Start the services back up.
  85. rem
  86. net start bits
  87. net start wuauserv
  88. rem
  89. rem Create an event viewer log in case if this needs a reminder.
  90. rem
  91. eventcreate /T Information /ID 24 /L System /SO WindowsUpdate /D "The windows update cache has been reset, You may have to check for updates again."
  92. rem
  93. rem End the batch session.
  94. rem
  95. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement