Advertisement
Guest User

update_reset.cmd

a guest
Nov 17th, 2019
126
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. regsvr32 atl.dll /s
  38. regsvr32 urlmon.dll /s
  39. regsvr32 mshtml.dll /s
  40. regsvr32 shdocvw.dll /s
  41. regsvr32 browseui.dll /s
  42. regsvr32 jscript.dll /s
  43. regsvr32 vbscript.dll /s
  44. regsvr32 scrrun.dll /s
  45. regsvr32 msxml.dll /s
  46. regsvr32 msxml3.dll /s
  47. regsvr32 msxml6.dll /s
  48. regsvr32 actxprxy.dll /s
  49. regsvr32 softpub.dll /s
  50. regsvr32 wintrust.dll /s
  51. regsvr32 dssenh.dll /s
  52. regsvr32 rsaenh.dll /s
  53. regsvr32 gpkcsp.dll /s
  54. regsvr32 sccbase.dll /s
  55. regsvr32 slbcsp.dll /s
  56. regsvr32 cryptdlg.dll /s
  57. regsvr32 oleaut32.dll /s
  58. regsvr32 ole32.dll /s
  59. regsvr32 shell32.dll /s
  60. regsvr32 initpki.dll /s
  61. regsvr32 wuapi.dll /s
  62. regsvr32 wuaueng.dll /s
  63. regsvr32 wuaueng1.dll /s
  64. regsvr32 wucltui.dll /s
  65. regsvr32 wups.dll /s
  66. regsvr32 wups2.dll /s
  67. regsvr32 wuweb.dll /s
  68. regsvr32 qmgr.dll /s
  69. regsvr32 qmgrprxy.dll /s
  70. regsvr32 wucltux.dll /s
  71. regsvr32 muweb.dll /s
  72. regsvr32 wuwebv.dll /s
  73. rem
  74. rem Jump to windows directory.
  75. rem
  76. cd %SystemRoot%
  77. rem
  78. rem Reset the permission presets for both services.
  79. rem
  80. sc sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
  81. sc sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
  82. rem
  83. rem Start the services back up.
  84. rem
  85. net start bits
  86. net start wuauserv
  87. rem
  88. rem Create an event viewer log in case if this needs a reminder.
  89. rem
  90. 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."
  91. rem
  92. rem End the batch session.
  93. rem
  94. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement