Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Created May 13, 2019 20:09
Show Gist options
  • Save joswr1ght/ec03f5f76cdb8b0c772d65b88ea8a6b1 to your computer and use it in GitHub Desktop.
Save joswr1ght/ec03f5f76cdb8b0c772d65b88ea8a6b1 to your computer and use it in GitHub Desktop.
Prep Windows VM Before Export
vssadmin delete shadows /All /Quiet
del c:\Windows\SoftwareDistribution\Download\*.* /f /s /q
del %windir%\$NT* /f /s /q /a:h
del c:\Windows\Prefetch\*.* /f /s /q
c:\windows\system32\cleanmgr /sagerun:1
wevtutil el 1>cleaneventlog.txt
for /f %%x in (cleaneventlog.txt) do wevtutil cl %%x
del cleaneventlog.txt
ipconfig /flushdns
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /f
sdelete64 /z c:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment