Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for nowinupd.bat

(view source code of nowinupd.bat as plain text)

  1. @ECHO OFF
  2. ECHO.
  3. ECHO NoWinUpd.bat,  Version 1.00 for Windows 9x / NT 4 / 2000
  4. ECHO Disable Windows' Update feature.
  5. ECHO.
  6. ECHO Note:
  7. ECHO Use WINUPD.BAT if you want to reenable Windows' Update feature.
  8. ECHO.
  9. ECHO Written by Rob van der Woude
  10. ECHO http://www.robvanderwoude.com
  11. ECHO.
  12. ECHO.
  13. ECHO Press any key to continue, or Ctrl+C to abort . . .
  14. PAUSE >NUL
  15. ECHO.
  16.  
  17. ECHO Creating temporary file . . .
  18. > "%Temp%.\NoWinUpd.reg" ECHO REGEDIT4
  19. >>"%Temp%.\NoWinUpd.reg" ECHO.
  20.  
  21. ECHO Checking Current User setting . . .
  22. IF EXIST "%Temp%.\NoWinUpd.dat" DEL "%Temp%.\NoWinUpd.dat"
  23. START /WAIT REGEDIT /E "%Temp%.\NoWinUpd.dat" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
  24. IF NOT EXIST "%Temp%.\NoWinUpd.dat" GOTO Next
  25. >>"%Temp%.\NoWinUpd.reg" ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
  26. >>"%Temp%.\NoWinUpd.reg" ECHO "NoWindowsUpdate"=dword:00000001
  27. >>"%Temp%.\NoWinUpd.reg" ECHO.
  28.  
  29. :Next
  30. ECHO Checking Local Machine setting . . .
  31. IF EXIST "%Temp%.\NoWinUpd.dat" DEL "%Temp%.\NoWinUpd.dat"
  32. START /WAIT REGEDIT /E "%Temp%.\NoWinUpd.dat" "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
  33. IF NOT EXIST "%Temp%.\NoWinUpd.dat" GOTO End
  34. >>"%Temp%.\NoWinUpd.reg" ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
  35. >>"%Temp%.\NoWinUpd.reg" ECHO "NoWindowsUpdate"=dword:00000001
  36. >>"%Temp%.\NoWinUpd.reg" ECHO.
  37.  
  38. :End
  39. IF EXIST "%Temp%.\NoWinUpd.dat" DEL "%Temp%.\NoWinUpd.dat"
  40.  
  41. ECHO Writing changes to registry . . .
  42. START /WAIT REGEDIT /S "%Temp%.\NoWinUpd.reg"
  43. IF EXIST "%Temp%.\NoWinUpd.reg" DEL "%Temp%.\NoWinUpd.reg"
  44. ECHO Done!
  45.  

page last modified: 2024-04-16; loaded in 0.0103 seconds