CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS

Tuesday, May 5, 2009

Cleaning up Temp files in WIndows.

Command to clean ALL the temp files on your machine (even those in other accounts.) I usually set this to run at startup, and on a schedule of about once a week.


@echo off

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\local settings\temp"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\local settings\temporary internet files"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\local settings\temporary internet files\content.IE5"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\local settings\history"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\local settings\cookies"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\cookies"

for /D %%d in ("C:\Documents and Settings\*.*") do del /f /s /q "%%d\UserData"


for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\local settings\temp"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\local settings\temporary internet files"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\local settings\temporary internet files\content.IE5"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\local settings\history"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\local settings\cookies"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\cookies"

for /D %%d in ("C:\Documents and Settings\*.*") do rd /q /s "%%d\UserData"

del /f /s /q C:\WINDOWS\Temp\*.*

del /f /s /q C:\Temp\*.*

del /f /s /q C:\WINDOWS\Prefetch\*.*


for /D %%d in ("C:\windows\system32\config\*.*") do del /f /s /q "%%d\local settings\temp"

for /D %%d in ("C:\windows\system32\config\*.*") do del /f /s /q "%%d\local settings\temporary internet files"

for /D %%d in ("C:\windows\system32\config\*.*") do del /f /s /q "%%d\local settings\temporary internet files\content.IE5"

for /D %%d in ("C:\windows\system32\config\*.*") do rd /q /s "%%d\local settings\temp"

for /D %%d in ("C:\windows\system32\config\*.*") do rd /q /s "%%d\local settings\temporary internet files"

for /D %%d in ("C:\windows\system32\config\*.*") do rd /q /s "%%d\local settings\temporary internet files\content.IE5"

Batch FTP

Just a quick windows batch command to download (or upload) a lot of files in batch.


::---Start download.cmd---
@echo off
setlocal

::Variables
set f=%temp%\ftpc.txt

::Compose ftp commands file
echo open "FTPSITE">%f%
echo user "USERNAME" "PASSWORD">>%f%
echo binary>>%f%
echo lcd "C:\FTP">>%f%
echo cd "SERVERDIR>>%f%
echo mput *WILDCARD*>>%f%
echo bye>>%f%

::Execute ftp command
::Use "-d" key for verbose output
ftp -n -i -d -s:%f%

::Cleanup
del /f /q %f%
endlocal
::---End download.cmd---