is it a good idea to delete this folder content "%Windir%\SoftwareDistribution\Download" and if a did that what will happen to installed Updates ! and to Updates History ! (i noticed that after deleting windows update says that you never installed an update on this PC in Win 8.1) if a deleted the content is Windows gonna Download them again !!
Yes a good idea. Nothing happens to installed updates or history. If you delete contents in "Download" folder Windows Update system its going to do its job again.
what do you mean with "Windows Update system its going to do its job again" do you mean download the updates again or just list them in update history !!
Here is what I do after Windows Updates. Save as command file, and run as administrator! Code: Dism.exe /online /Cleanup-Image /StartComponentCleanup pause cd C:\Windows\SoftwareDistribution\ del * /S /Q rmdir /S /Q "C:\Windows\SoftwareDistribution\Download\" pause shutdown.exe /r /t 0
Good it should be better like this Code: @echo off net stop wuauserv Dism.exe /online /Cleanup-Image /StartComponentCleanup cd C:\Windows\SoftwareDistribution\ del * /S /Q rmdir /S /Q "C:\Windows\SoftwareDistribution\Download\" net start wuauserv pause shutdown.exe /r /t 0
I just made it more Fun to use this script will Get the Folder Size then clean things then Get the Folder Size again and count the difference between them and show a message Box containing the files size that you cleaned Tip : you can remove this part of code if you don't want the first MsgBox to show up Code: echo MsgBox "You have %MB% Mb (%GB% GB) Update Junk need to be cleaned."> msgbox.vbs cscript msgbox.vbs Del msgbox.vbs Spoiler Code: @echo off set Dir="%Windir%\SoftwareDistribution" for /f "tokens=1,3" %%a in ('dir /w /s /-c %Dir% ^| findstr "File(s)"') do set bytes=%%b set /a KB=(%bytes% /1024) set /a MB=(%KB% /1024) set /a GB=(%MB% /1024) echo MsgBox "You have %MB% Mb (%GB% GB) Update Junk need to be cleaned."> msgbox.vbs cscript msgbox.vbs Del msgbox.vbs net stop wuauserv Dism.exe /online /Cleanup-Image /StartComponentCleanup cd %Windir%\SoftwareDistribution\ del * /S /Q rmdir /S /Q "%Windir%\SoftwareDistribution\Download\" net start wuauserv for /f "tokens=1,3" %%a in ('dir /w /s /-c %Dir% ^| findstr "File(s)"') do set bytes2=%%b set /a KB2=(%bytes2% /1024) set /a MB2=(%KB2% /1024) set /a GB2=(%MB2% /1024) set /a SIZEMB=%MB%-%MB2% set /a SIZEGB=%GB%-%GB2% cls echo MsgBox "You have cleaned %SIZEMB% Mb (%SIZEGB% GB)."> msgbox.vbs cscript msgbox.vbs Del msgbox.vbs
is it possible then for me to save this folder somewhere else, so that next time I reinstall windows, I just put back the folder and let windows install without downloading?
Just one nit to pick in an otherwise great script. You need to run this script from your system drive, usually C:\ or you can add the system variable %systemdrive% to the very beginning of the script. If you run it from another partition, the "del * /S /Q" and subsequent commands will fail, because they are run from the current directory (D:\Software) where the script resides. Well they don't exactly fail, but they *will* delete all the files in the current directory including the script itself. Once that one change gets made the script runs perfectly and I was able to delete over 900MB of junk files.
1.MSOCache I think this is where Office cache it files and you can update it normally if you deleted the folder look for it in Technet forumbut i will remove it from the script anyway 1.SoftwareDistribution in this folder there is all windows update stuff Downloads-Logs-History... deleting all these files is just fine (i tried it) Thanks.
Thanks for this info i changed the script to this DEL /S /Q "%Windir%\SoftwareDistribution\Download\*.*"
When using Windows 7, if I deleted all contents of the SoftwareDistribution folder, I would get errors and not be able to install some of the Microsoft Visual C++ components. Confirmed this a few times so now I learned my lesson never to touch that folder. I only use the Disk Cleanup Tool in Windows to clean the updates although it doesn't clean that folder. CCleaner doesn't clean it either so there must be a reason behind it. Leave the freakin's OS files alone if you don't want headaches.