JorgTheElder

WindowsUpdate_Reset.cmd

Mar 12th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.90 KB | None | 0 0
  1. @echo off
  2. cls
  3. ECHO  WindowsUpdate_Reset.cmd - jorgie@missouri.edu
  4. ECHO  Resets Windows Update components
  5. ECHO.
  6.  
  7. REM Based partially on info I learned from:
  8. REM Shawn Brink
  9. REM http://www.tenforums.com
  10. REM Tutorial: http://www.tenforums.com/tutorials/24742-windows-update-reset-windows-10-a.html
  11.  
  12. SET SCRIPT=%~dp0
  13. SET ROOT=%SCRIPT:~0,-1%
  14.  
  15. :CHECKADMIN
  16. OPENFILES.EXE > NUL 2>&1
  17. IF NOT %ERRORLEVEL% == 0 (
  18.   ECHO  This CMD file must be run with elevated rights.
  19.  ECHO  Right-Click on the file and select 'Run as administrator...'
  20.  GOTO END
  21. )
  22.  
  23. ECHO.
  24. ECHO  This script will attempt reset all Windows Update components
  25. ECHO.
  26. ECHO  Press Ctrl-C to abort, any other key to continue.
  27. PAUSE > NUL
  28. ECHO.
  29.  
  30. ECHO * Stopping Services
  31. ECHO ON
  32. net stop bits
  33. net stop wuauserv
  34. net stop appidsvc
  35. net stop cryptsvc
  36.  
  37. @ECHO * Deleting Downloader DAT files
  38. DEL "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"
  39.  
  40. @ECHO * Switching to system32 folder
  41. CD /d %windir%\system32
  42.  
  43. @ECHO * Reregistering DLLs
  44. IF EXIST atl.dll regsvr32.exe atl.dll /s
  45. IF EXIST urlmon.dll regsvr32.exe urlmon.dll /s
  46. IF EXIST mshtml.dll regsvr32.exe mshtml.dll /s
  47. IF EXIST shdocvw.dll regsvr32.exe shdocvw.dll /s
  48. IF EXIST browseui.dll regsvr32.exe browseui.dll /s
  49. IF EXIST jscript.dll regsvr32.exe jscript.dll /s
  50. IF EXIST vbscript.dll regsvr32.exe vbscript.dll /s
  51. IF EXIST scrrun.dll regsvr32.exe scrrun.dll /s
  52. IF EXIST msxml.dll regsvr32.exe msxml.dll /s
  53. IF EXIST msxml3.dll regsvr32.exe msxml3.dll /s
  54. IF EXIST msxml6.dll regsvr32.exe msxml6.dll /s
  55. IF EXIST actxprxy.dll regsvr32.exe actxprxy.dll /s
  56. IF EXIST softpub.dll regsvr32.exe softpub.dll /s
  57. IF EXIST wintrust.dll regsvr32.exe wintrust.dll /s
  58. IF EXIST dssenh.dll regsvr32.exe dssenh.dll /s
  59. IF EXIST rsaenh.dll regsvr32.exe rsaenh.dll /s
  60. IF EXIST gpkcsp.dll regsvr32.exe gpkcsp.dll /s
  61. IF EXIST sccbase.dll regsvr32.exe sccbase.dll /s
  62. IF EXIST slbcsp.dll regsvr32.exe slbcsp.dll /s
  63. IF EXIST cryptdlg.dll regsvr32.exe cryptdlg.dll /s
  64. IF EXIST oleaut32.dll regsvr32.exe oleaut32.dll /s
  65. IF EXIST ole32.dll regsvr32.exe ole32.dll /s
  66. IF EXIST shell32.dll regsvr32.exe shell32.dll /s
  67. IF EXIST initpki.dll regsvr32.exe initpki.dll /s
  68. IF EXIST wuapi.dll regsvr32.exe wuapi.dll /s
  69. IF EXIST wuaueng.dll regsvr32.exe wuaueng.dll /s
  70. IF EXIST wuaueng1.dll regsvr32.exe wuaueng1.dll /s
  71. IF EXIST wucltui.dll regsvr32.exe wucltui.dll /s
  72. IF EXIST wups.dll regsvr32.exe wups.dll /s
  73. IF EXIST wups2.dll regsvr32.exe wups2.dll /s
  74. IF EXIST wuweb.dll regsvr32.exe wuweb.dll /s
  75. IF EXIST qmgr.dll regsvr32.exe qmgr.dll /s
  76. IF EXIST qmgrprxy.dll regsvr32.exe qmgrprxy.dll /s
  77. IF EXIST wucltux.dll regsvr32.exe wucltux.dll /s
  78. IF EXIST muweb.dll regsvr32.exe muweb.dll /s
  79. IF EXIST wuwebv.dll regsvr32.exe wuwebv.dll /s
  80.  
  81. @ECHO * Resetting Winsock
  82. netsh winsock reset
  83.  
  84. @ECHO * Starting Services
  85. net start bits
  86. net start wuauserv
  87. net start appidsvc
  88. net start cryptsvc
  89.  
  90. :END
  91. PAUSE
Add Comment
Please, Sign In to add comment