Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 5,493 Posts 2,315 Joined 2006-05-01 10:41 20-year member UID 54766 Gender Male From 上海
Status Offline
Stupid way to find and filter without deleting
@echo off
dir /s /a-d /b /x >tmp.txt
type tmp.txt|find /i /v "sp2qfe" >tmp1.txt
type tmp1.txt|find /i /v "update" >tmp2.txt
type tmp2.txt|find /i /v "%~n0" >tmp3.txt
for /f "delims=*" %%i in (tmp3.txt) do echo del /f /s /q %%i
del tmp*.txt 2>nul
dir /s /ad /b >tmp.txt
type tmp.txt|find /i /v "sp2qfe" >tmp1.txt
type tmp1.txt|find /i /v "update" >tmp2.txt
for /f "delims=*" %%i in (tmp2.txt) do echo rd /q %%i
del tmp*.txt 2>nul
pause This batch script is very destructive when the red echo part is removed, especially in the root directory. Please use it with caution. I am not responsible.
[ Last edited by fastslz on 2007-10-21 at 01:22 PM ]
Credits 88 Posts 34 Joined 2007-10-20 14:06 18-year member UID 100256 Gender Male
Status Offline
Originally posted by fastslz at 2007-10-21 01:21 PM:
Clumsy method: find and filter without deleting
@echo off
dir /s /a-d /b /x >tmp.txt
type tmp.txt|find /i /v "sp2qfe" >tmp1.txt
type tmp1.txt|find /i /v "update" >tmp2.txt
type t ...