 |
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.
Windows 7 - Script or command to delete contents of Software Distribution folder? |
10-26-2010
|
#1 | | |
Script or command to delete contents of Software Distribution folder? Hi all. Anyone able to suggest a vbs (or command-line file) to clean out C:\Windows\Software Distribution\Download?
Thanks, I'm aware of the significance (or lack of) of this folder, and I realize I could just drill down to it and manually dump the contents. I'm just looking for a more elegant solution.
Incidentally, the folder seems to named 'SoftwareDistribution' on my XP machines, but 'Software Distribution' (with a space) on my Windows 7 pc. Maybe just a glitch in the matrix?
Cheers :-)
| My System Specs | | System Manufacturer/Model Number MyBuild Ltd.Inc. OS XPPSP3, Win7Ultimate |
10-26-2010
|
#2 | | Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx |
Hello,
Save the the below text a Notepad. And save it as a batch file. i.e.
File > Save as > <filename>.bat Note: You have to Right Click on the Batch File and Run as administrator Code: net stop wuauserv
ren %windir%\SoftwareDistribution SD.old
net start wuauserv Hope this helps,
Captain | My System Specs | | System Manufacturer/Model Number Custom Build OS Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx Motherboard Asus A8N-VM Memory 2 GB Graphics Card Nvidia GeForce 6150 Sound Card Sound Blaster Audigy 24-Bit Monitor(s) Displays Samsung SyncMaster 2253LW 21.6" Widescreen LCD Monitor Hard Drives 320 GB - Internal
1 TB WD External |
10-26-2010
|
#3 | | |
Thanks Captain, looks like it'll do the trick! | My System Specs | | System Manufacturer/Model Number MyBuild Ltd.Inc. OS XPPSP3, Win7Ultimate |
10-26-2010
|
#4 | | |
Later: Sorry, it didn't do the whole job. What I've ended up with after a reboot is:
a) A folder named SD.old that still contains the original files. What I was aiming at was a quick way of emptying the contents of the SoftwareDistribution\Download folder.
b) Oddly, perhaps because I routinely disable Windows Update, there's no fresh incarnation of C:\Windows\SoftwareDistribution together with its attendant subfolders. Still, that's no BFD, I guess if Update was turned on, the folder might have been rebuilt.
Any suggestions? | My System Specs | | System Manufacturer/Model Number MyBuild Ltd.Inc. OS XPPSP3, Win7Ultimate |
10-26-2010
|
#5 | | Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx |

Quote: Originally Posted by teckneeculler Later: Sorry, it didn't do the whole job. What I've ended up with after a reboot is:
a) A folder named SD.old that still contains the original files. What I was aiming at was a quick way of emptying the contents of the SoftwareDistribution\Download folder.
b) Oddly, perhaps because I routinely disable Windows Update, there's no fresh incarnation of C:\Windows\SoftwareDistribution together with its attendant subfolders. Still, that's no BFD, I guess if Update was turned on, the folder might have been rebuilt.
Any suggestions? I believe so. We used to rename that folder to troubleshoot Windows Update issues. Once you update through Windows it should rebuild the folder. | My System Specs | | System Manufacturer/Model Number Custom Build OS Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx Motherboard Asus A8N-VM Memory 2 GB Graphics Card Nvidia GeForce 6150 Sound Card Sound Blaster Audigy 24-Bit Monitor(s) Displays Samsung SyncMaster 2253LW 21.6" Widescreen LCD Monitor Hard Drives 320 GB - Internal
1 TB WD External |
10-26-2010
|
#6 | | Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx |
To empty the contents you could try this command Code: del %windir%\SoftwareDistribution\Download\. /f /q
for /f "tokens=*" %%i in ('dir %windir%\SoftwareDistribution\Download\. /b') do rd "%windir%\SoftwareDistribution\Download\%%i" /s /q | My System Specs | | System Manufacturer/Model Number Custom Build OS Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx Motherboard Asus A8N-VM Memory 2 GB Graphics Card Nvidia GeForce 6150 Sound Card Sound Blaster Audigy 24-Bit Monitor(s) Displays Samsung SyncMaster 2253LW 21.6" Widescreen LCD Monitor Hard Drives 320 GB - Internal
1 TB WD External |
11-07-2010
|
#7 | | |
Thanks for the command. How would it be if I saved it as a bat file? | My System Specs | | System Manufacturer/Model Number MyBuild Ltd.Inc. OS XPPSP3, Win7Ultimate |
11-07-2010
|
#8 | | Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx |

Quote: Originally Posted by teckneeculler Thanks for the command. How would it be if I saved it as a bat file? Copy it to a Notepad. Then go to File > Save as > filename.bat and save it. Make sure when you run it right click and run as administrator. | My System Specs | | System Manufacturer/Model Number Custom Build OS Windows 7 Ultimate, Ubuntu 10.04 LTS - the Lucid Lynx Motherboard Asus A8N-VM Memory 2 GB Graphics Card Nvidia GeForce 6150 Sound Card Sound Blaster Audigy 24-Bit Monitor(s) Displays Samsung SyncMaster 2253LW 21.6" Widescreen LCD Monitor Hard Drives 320 GB - Internal
1 TB WD External Script or command to delete contents of Software Distribution folder? problems? All times are GMT -5. The time now is 03:16 AM. |  |