SHARE
TWEET

Windows Update Fix

TairikuOkami Nov 4th, 2016 (edited) 1,981 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rem USE AT OWN RISK AS IS WITHOUT WARRANTY OF ANY KIND !!!!!
  2.  
  3. rem FixWin - http://www.thewindowsclub.com/fixwin-for-windows-10
  4. rem Windows Drivers - http://www.catalog.update.microsoft.com
  5. rem Windows Repair Toolbox - https://windows-repair-toolbox.com
  6. rem Windows Update Agent Reset - https://gallery.technet.microsoft.com/scriptcenter/reset-windows-update-agent-d824badc
  7. rem Windows Update Troubleshooter - https://aka.ms/wudiag
  8.  
  9. rem Reliability Monitor
  10. rem perfmon /rel
  11.  
  12. rem https://www.tenforums.com/tutorials/2304-boot-into-safe-mode-windows-10-a.html#option3
  13. rem bcdedit /set {identifier} safeboot minimal
  14.  
  15. rem To reset password/gain admin access/enable local admin account
  16. rem copy /y c:\windows\system32\cmd.exe c:\windows\system32\utilman.exe
  17. rem net user username password
  18. rem net user Administrator /active:yes
  19. rem net user Administrator *
  20. rem net user NewGuy * /add
  21. rem net localgroup Administrators NewGuy /add
  22.  
  23. rem https://technet.microsoft.com/en-gb/library/bb490876.aspx
  24. rem https://blogs.msdn.microsoft.com/b8/2012/05/09/redesigning-chkdsk-and-the-new-ntfs-health-model/
  25. rem To repair bad sectors run
  26. rem chkdsk %SystemDrive% /r
  27.  
  28. rem To fix boot - https://neosmart.net/wiki/bootrec/#Bootrec_in_Windows10
  29. rem bootrec / fixmbr
  30. rem bootrec / fixboot
  31. rem bootrec / rebuildbcd
  32.  
  33. rem To edit Registry (if you can not boot into Windows)
  34. rem Boot Windows USB - Repair - Troubleshoot - CMD - type/enter
  35. rem c:
  36. rem cd windows
  37. rem cmd
  38. rem regedit
  39. rem Select HKLM (or required key)
  40. rem File - Load Hive - %WinDir%\System32\Config (select required Hive, like System/HKLM)
  41. rem SAVE - Unload Hive (when you finish editing)
  42.  
  43. rem To fix Windows corrupted files
  44. sfc /scannow
  45.  
  46. schtasks /Change /TN "Microsoft\Windows\TextServicesFramework\MsCtfMonitor" /Enable
  47. schtasks /Run /TN "Microsoft\Windows\TextServicesFramework\MsCtfMonitor"
  48.  
  49. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f
  50. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /f
  51. reg delete "HKCU\Software\Microsoft\WindowsSelfHost" /f
  52. reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
  53. reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate" /f
  54. reg delete "HKLM\Software\Microsoft\WindowsSelfHost" /f
  55. reg delete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /f
  56. reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
  57.  
  58. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies" /f
  59. reg delete "HKCU\Software\Policies" /f
  60. reg delete "HKLM\Software\Microsoft\Policies" /f
  61. reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies" /f
  62. reg delete "HKLM\Software\Policies" /f
  63. reg delete "HKLM\Software\WOW6432Node\Microsoft\Policies" /f
  64. reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" /f
  65. reg delete "HKLM\Software\WOW6432Node\Policies" /f
  66.  
  67. reg add "HKLM\Software\Policies\Microsoft\Windows NT\Terminal Services"
  68.  
  69. sc config bits start= disabled
  70. sc config cryptSvc start= disabled
  71. sc config msiserver start= disabled
  72. sc config UsoSvc start= disabled
  73. sc config winmgmt start= disabled
  74. sc config wuauserv start= disabled
  75.  
  76. taskkill /im TiWorker.exe /f
  77. taskkill /im trustedinstaller.exe /f
  78.  
  79. net stop bits /y
  80. net stop cryptSvc /y
  81. net stop msiserver /y
  82. net stop UsoSvc /y
  83. net stop winmgmt /y
  84.  
  85. winmgmt /salvagerepository
  86.  
  87. net stop wuauserv /y
  88.  
  89. takeown /f "%WINDIR%\winsxs\pending.xml" /a
  90. icacls "%WINDIR%\winsxs\pending.xml" /grant:r Administrators:F /c
  91. del "%WINDIR%\winsxs\pending.xml" /s /f /q
  92.  
  93. del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat" /s /f /q
  94. del "%ALLUSERSPROFILE%\Microsoft\Network\Downloader\qmgr*.dat" /s /f /q
  95. del "%LocalAppData%\Microsoft\Windows\INetCache" /s /f /q
  96. del "%LocalAppData%\Microsoft\Windows\WebCache" /s /f /q
  97. del "%LocalAppData%\Temp" /s /f /q
  98. del "%temp%" /s /f /q
  99. del "%WINDIR%\Logs" /s /f /q
  100. del "%WINDIR%\Installer\$PatchCache$" /s /f /q
  101. del "%WINDIR%\SoftwareDistribution" /s /f /q
  102. del "%WINDIR%\System32\winevt\Logs" /s /f /q
  103. del "%WINDIR%\Temp" /s /f /q
  104. del "%WINDIR%\WinSxS\Backup" /s /f /q
  105.  
  106. rem Optional (you have to stop cryptSvc), it might take a while, till Catroot2's Folder is recreated (about an hour)
  107. rem takeown /f "%WINDIR%\System32\catroot2" /a
  108. rem icacls "%WINDIR%\System32\catroot2" /grant:r Administrators:F /c
  109. rem ren "%WINDIR%\System32\catroot2" "catroot2.bak"
  110.  
  111. reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "IconStreams" /f
  112. reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "PastIconsStream" /f
  113. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" /v "NOC_GLOBAL_SETTING_TOASTS_ENABLED" /t REG_DWORD /d "1" /f
  114. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Program-Telemetry" /v "Enabled" /t REG_DWORD /d "3" /f
  115.  
  116. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\AppModel" /v "Start" /t REG_DWORD /d "1" /f
  117. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener" /v "Start" /t REG_DWORD /d "1" /f
  118. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\Circular Kernel Context Logger" /v "Start" /t REG_DWORD /d "1" /f
  119. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\CShellCircular" /v "Start" /t REG_DWORD /d "1" /f
  120. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\CloudExperienceHostOobe" /v "Start" /t REG_DWORD /d "1" /f
  121. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\EventLog-Application" /v "Start" /t REG_DWORD /d "1" /f
  122. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\EventLog-Security" /v "Start" /t REG_DWORD /d "1" /f
  123. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\EventLog-System" /v "Start" /t REG_DWORD /d "1" /f
  124. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DiagLog" /v "Start" /t REG_DWORD /d "1" /f
  125. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\FaceRecoTel" /v "Start" /t REG_DWORD /d "1" /f
  126. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\FaceUnlock" /v "Start" /t REG_DWORD /d "1" /f
  127. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\LwtNetLog" /v "Start" /t REG_DWORD /d "1" /f
  128. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\NetCore" /v "Start" /t REG_DWORD /d "1" /f
  129. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\NtfsLog" /v "Start" /t REG_DWORD /d "1" /f
  130. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\ReadyBoot" /v "Start" /t REG_DWORD /d "1" /f
  131. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\TileStore" /v "Start" /t REG_DWORD /d "1" /f
  132. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\Tpm" /v "Start" /t REG_DWORD /d "1" /f
  133. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\UBPM" /v "Start" /t REG_DWORD /d "1" /f
  134. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\WdiContextLog" /v "Start" /t REG_DWORD /d "1" /f
  135. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\WiFiDriverIHVSession" /v "Start" /t REG_DWORD /d "1" /f
  136. reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\WiFiSession" /v "Start" /t REG_DWORD /d "1" /f
  137.  
  138. reg add "HKLM\System\CurrentControlSet\Services\AppXSvc" /v "Start" /t REG_DWORD /d "2" /f
  139. reg add "HKLM\System\CurrentControlSet\Services\BFE" /v "Start" /t REG_DWORD /d "2" /f
  140. reg add "HKLM\System\CurrentControlSet\Services\Dnscache" /v "Start" /t REG_DWORD /d "2" /f
  141. reg add "HKLM\System\CurrentControlSet\Services\DoSvc" /v "Start" /t REG_DWORD /d "3" /f
  142. reg add "HKLM\System\CurrentControlSet\Services\MpsSvc" /v "Start" /t REG_DWORD /d "2" /f
  143. reg add "HKLM\System\CurrentControlSet\Services\NgcSvc" /v "Start" /t REG_DWORD /d "3" /f
  144. reg add "HKLM\System\CurrentControlSet\Services\NgcCtnrSvc" /v "Start" /t REG_DWORD /d "3" /f
  145. reg add "HKLM\System\CurrentControlSet\Services\PimIndexMaintenanceSvc" /v "Start" /t REG_DWORD /d "2" /f
  146. reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "2" /f
  147. reg add "HKLM\System\CurrentControlSet\Services\SgrmBroker" /v "Start" /t REG_DWORD /d "2" /f
  148. reg add "HKLM\System\CurrentControlSet\Services\SystemEventsBroker" /v "Start" /t REG_DWORD /d "2" /f
  149. reg add "HKLM\System\CurrentControlSet\Services\tiledatamodelsvc" /v "Start" /t REG_DWORD /d "2" /f
  150. reg add "HKLM\System\CurrentControlSet\Services\UnistoreSvc" /v "Start" /t REG_DWORD /d "2" /f
  151. reg add "HKLM\System\CurrentControlSet\Services\UserDataSvc" /v "Start" /t REG_DWORD /d "2" /f
  152. reg add "HKLM\System\CurrentControlSet\Services\WinHttpAutoProxySvc" /v "Start" /t REG_DWORD /d "3" /f
  153. reg add "HKLM\System\CurrentControlSet\Services\WpnUserService" /v "Start" /t REG_DWORD /d "2" /f
  154. reg add "HKLM\System\CurrentControlSet\Services\wscsvc" /v "Start" /t REG_DWORD /d "2" /f
  155.  
  156. sc config Appinfo start= auto
  157. sc config bits start= demand
  158. sc config cryptSvc start= auto
  159. sc config Dhcp start= auto
  160. sc config DiagTrack start= auto
  161. sc config diagnosticshub.standardcollector.service start= demand
  162. sc config dmwappushservice start= auto
  163. sc config DPS start= auto
  164. sc config EventLog start= auto
  165. sc config EventSystem start= auto
  166. sc config lmhosts start= auto
  167. sc config KeyIso start= auto
  168. sc config Netman start= demand
  169. sc config NcbService start= demand
  170. sc config netprofm start= auto
  171. sc config NlaSvc start= auto
  172. sc config nsi start= auto
  173. sc config ProfSvc start= auto
  174. sc config RmSvc start= auto
  175. sc config TabletInputService start= auto
  176. sc config TokenBroker start= auto
  177. sc config TrkWks start= auto
  178. sc config WdiServiceHost start= demand
  179. sc config wisvc start= demand
  180. sc config winmgmt start= demand
  181. sc config Wcmsvc start= auto
  182. sc config WdiServiceHost start= demand
  183. sc config WlanSvc start= auto
  184. sc config WpnService start= auto
  185. sc config wuauserv start= auto
  186. sc config WwanSvc start= demand
  187.  
  188. rem To restart explorer
  189. taskkill /im explorer.exe /f & explorer.exe
  190.  
  191. fsutil usn deletejournal /d /n c:
  192. chkdsk /scan
  193. ipconfig /flushdns
  194. vssadmin delete shadows /for=c: /all /quiet
  195. Dism /Online /Cleanup-Image /RestoreHealth
  196. Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase
  197.  
  198. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  199. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  200. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Content Indexer Cleaner" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  201. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\D3D Shader Cache" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  202. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Delivery Optimization Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  203. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Device Driver Packages" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  204. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Diagnostic Data Viewer database files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  205. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  206. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  207. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameStatisticsFiles" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  208. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameUpdateFiles" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  209. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  210. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files" /v "StateFlags6553" /t REG_DWORD /d "0" /f
  211. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  212. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  213. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  214. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\RetailDemo Offline Content" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  215. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Service Pack Cleanup" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  216. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  217. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  218. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  219. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  220. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  221. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Sync Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  222. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  223. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" /v "StateFlags6553" /t REG_DWORD /d "0" /f
  224. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Upgrade Discarded Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  225. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  226. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  227. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  228. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows ESD installation files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  229. reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Upgrade Log Files" /v "StateFlags6553" /t REG_DWORD /d "2" /f
  230. cleanmgr /sageset:65535 & cleanmgr /sagerun:65535
  231.  
  232. shutdown /r
  233.  
  234. rem Type this to cancel restart
  235. rem shutdown -a
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top