Windows simple nice cleaner script



I’ve made some research cleaning Old windows vmware disks enjoying “old style of 90’s”

Here are a nice script , it  cleans Explorer cache & makes automatic cleanup

< Begin Code >

cleanmgr /sagerun:11
@echo off

Set “RegKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList”
set “regkey2=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\shell folders”

call:getspecialfolders “Cache, History, Cookies”

For /f “tokens=*” %%? in (
‘Reg.exe QUERY “%RegKey%” ^|findstr /ric:”\S-1-5-21-[0-9]*-[0-9]*-[0-9]*-[0-9]*$”‘
) do (
For /f “tokens=2,*” %%A in (
‘Reg.exe QUERY “%%?” /v ProfileImagePath ^|find /i “ProfileImagePath”‘
) do call:Go %%B

start “”/w “%windir%\system32\RunDll32.exe” InetCpl.cpl,ClearMyTracksByProcess 255

:end ***
call Set “Target=%*”
If EXIST “%Target%” call:Clear “%Target%”
exit /b 0

rem echo.&echo.%~1\%$$Cache%\Content.IE5
pushD “%~1\%$$Cache%\Content.IE5” &&(
rmdir /s /q .

rem echo.&echo.%~1\%$$History%\History.IE5
pushD “%~1\%$$History%\History.IE5” &&(
rmdir /s /q .

rem echo.&echo.%~1\%$$History%
pushD “%~1\%$$History%” &&(
rmdir /s /q .

rem echo.&echo.%~1\%$$Cookies%
pushD “%~1\%$$Cookies%” &&(
rmdir /s /q .

rem echo.&echo.%~1\%$$Cache%
pushD “%~1\%$$Cache%” &&(
rmdir /s /q .

rem echo.&echo.%~1\%$$temp%
pushD “%~1\%$$temp%” &&(
rmdir /s /q .
exit /b 0

Set “FoldersToClear=%~1”

For %%* in (%FoldersToClear%) Do (
For /f “tokens=2,*” %%A in (
‘reg.exe query “%regkey2%” /v %%* ^|find /i “%%~*”‘
) do Call:sf1 “%%~B” “%%~*”
Call:sf2 “%temp%” “temp” “%userprofile%”
exit /b 0

Call set “sf=%~1”
Call set “$$%~2=%%sf:%userprofile%\=%%”
exit /b 0

Call set “sf=%~1”
call Set “usr=%~dpns3”
Call set “$$%~2=%%sf:%usr%\=%%”
exit /b 0

<end code >

One thought on “Windows simple nice cleaner script

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.