4 replies
by tchieng
Your program there can not be done easily with a batch file. Your best bet is to do it in a programming language like C or Pascal that can do recursive calls.
Look on the Internet. It probably already exists somewhere - just need to find it. Can't find one? I might be able to write you one if I have some free time.
by roman_empire
Download and try KillJunk.cmd at http://come.to/vaviland (at your own risk!).
Regards,
Andreas Vavra
by roman_empire
@echo off
REM ########
REM ## KillJunk.cmd by Andreas Vavra (Andreas.Vavra@brz.gv.at) (C) 2000
REM ## aka Vavi (andi@compass.co.at)
REM ##
REM ## This scripts removes all directories named %2 in %1 including all of their
REM ## subdirectories.
REM ##
REM ## USE AT YOUR OWN RISK!
REM ##
REM ########
if (%1)==() goto USAGE
if (%2)==() goto USAGE
if not exist %1 goto NOROOT
cd /D %1
for /D /R %%i in (*.*) do if (%%~ni)==(%2) rd %%i /S /Q
goto ENDE
:NOROOT
echo root-dir %1 does not exist
goto ENDE
:NOJUNK
echo junk-dir %2 does not exist
goto ENDE
:USAGE
echo USAGE killjunk.cmd "root-dir" "junk-dir-name"
goto ENDE
:ENDE
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending