Recover Windows Server Disk Space from the Command Line

Editor’s note – this is a work in progress.  If you have a sample command and syntax that can be used to free up space on a server, please leave a comment.

Windows Server 2008

Purge IIS logs older than 7 days
forfiles -p "%SystemDrive%\inetpub\logs\LogFiles\W3SVC1" -s -m *.log /D -7 /C "cmd /c del @path"

Empty recycle bin for all user profiles
rd /s %systemdrive%\$Recycle.Bin /q

Windows Server 2008 SBS

Purge IIS logs older than 7 days
forfiles -p "%SystemDrive%\inetpub\logs\LogFiles\W3SVC1" -s -m *.log /D -7 /C "cmd /c del @path"

Empty recycle bin for all user profiles
rd /s %SystemDrive%\$Recycle.Bin /q

Windows Server 2003

Purge IIS logs older than 7 days
forfiles -p " %systemroot%\System32\LogFiles\W3SVC1" -s -m *.log* /D -7 /C "cmd /c del @path"

Empty recycle bin for all user profiles
rd /s %systemdrive%\recycler /q

WIndows Server 2003 SBS

Empty recycle bin for all user profiles
rd /s %systemdrive%\recycler /q

stuff to be tested
Clear IE Cache from command line
Win7\WinXP\Vista

All, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
History, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
Cookies, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
Temp Internet Files, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
Form Data, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
Passwords, RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Memory dump files
Win2k3Svr
%AllUsersProfile%\Application Data\Microsoft\Dr Watson\
%Windir%\minidump\
%SystemRoot%\MEMORY.dmp

Remote Desktop Connection cache files
Win2k3svr
%Userprofile%\Local Settings\Application Data\Microsoft\Terminal Server Client\cache