Advertisement
Guest User

Untitled

a guest
Apr 16th, 2019
3,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. REM *********************
  2. REM Stop and disable Windows update service
  3. REM *********************
  4. sc stop wuauserv
  5. sc config wuauserv start= disabled
  6. REM *********************
  7. REM Delete any existing shadow copies
  8. REM *********************
  9. vssadmin delete shadows /All /Quiet
  10. REM *********************
  11. REM delete files in c:\Windows\SoftwareDistribution\Download\
  12. REM *********************
  13. del c:\Windows\SoftwareDistribution\Download\*.* /f /s /q
  14. REM *********************
  15. REM delete hidden install files
  16. REM *********************
  17. del %windir%\$NT* /f /s /q /a:h
  18. REM *********************
  19. REM delete prefetch files
  20. REM *********************
  21. del c:\Windows\Prefetch\*.* /f /s /q
  22. REM *********************
  23. REM Run Disk Cleanup to remove temp files, empty recycle bin
  24. REM and remove other unneeded files
  25. REM Note: Makes sure to run c:\windows\system32\cleanmgr /sageset:1 command
  26. REM on your initially created parent image and check all the boxes
  27. REM of items you want to delete
  28. REM *********************
  29. c:\windows\system32\cleanmgr /sagerun:1
  30. REM ********************
  31. REM Defragment the VM disk
  32. REM ********************
  33. sc config defragsvc start= auto
  34. net start defragsvc
  35. defrag c: /U /V
  36. net stop defragsvc
  37. sc config defragsvc start = disabled
  38. REM *********************
  39. REM Clear all event logs
  40. REM *********************
  41. wevtutil el 1>cleaneventlog.txt
  42. for /f %%x in (cleaneventlog.txt) do wevtutil cl %%x
  43. del cleaneventlog.txt
  44. REM *********************
  45. REM release IP address
  46. REM *********************
  47. ipconfig /release
  48. REM *********************
  49. REM Flush DNS
  50. REM *********************
  51. ipconfig /flushdns
  52. REM *********************
  53. REM Shutdown VM
  54. REM *********************
  55. shutdown /s /t 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement