Skip to search.
batchworld · Batch World

Group Information

  • Members: 1062
  • Founded: Mar 5, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

  Messages Help
Advanced
clean useless files efficiently   Message List  
Reply Message #8688 of 8697 |
Re: [BATCH WORLD] clean useless files efficiently

Hi Aristos!

Try the following. Run the program and make sure the output is
correct before deleting ECHO on the second last line. The two
commented lines are an example of how you can change directory and
start deleting folders relative to the new directory.

Please note this program only finds folders that match the string
supplied by the CALL statement at the beginning of the directory name.
For instance,

CALL :_deltree "lime"

would match all folders in the current directory such as "Lime",
"limestone" or even "limey", but not "Slime" or "Lemon and Lime",

good luck,
John

- - - -

@echo off & setlocal enableextensions disabledelayedexpansion

cd /d %SystemRoot%
call :_deltree "$NtUninstall"
call :_deltree "$MSI31Uninstall"
call :_deltree "$NtServicePack"
call :_deltree "$UninstallRDC"
call :_deltree "$hf_mig"

:: cd /d %UserProfile%\Local Settings
:: call :_deltree "Temp"

endlocal & exit /b 0

:_deltree
for /f "delims=" %%f in ('dir /b /ad "%~1*"') do ^
echo rd /s /q "%cd%\%%~f"
goto :EOF



Thu Dec 22, 2011 9:59 pm

sponge.belly
Offline Offline
Send Email Send Email

Message #8688 of 8697 |
Expand Messages Author Sort by Date

Hi all, I am currently using this in a batch file, to clear useless files from my %WINDIR% set unf=%SystemRoot%\$NtUninstall* for /f "Tokens=*" %%i in ('dir /B...
Aristos Vasiliou
aristos_vasi... Offline Send Email
Dec 14, 2011
1:23 pm

Hi Aristos! Try the following. Run the program and make sure the output is correct before deleting ECHO on the second last line. The two commented lines are...
John O'Regan
sponge.belly Offline Send Email
Dec 22, 2011
9:59 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help