清除D盘下资料,只留下ducoments文件夹里的资料。希望是直接删除,而不是先把documents移到其它盘后格式化D盘,最后又把documents移回来。
为自己是中国人而倍感骄傲
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off
cd\&d:
for /f "delims=" %%i in ('dir /s /ad /b') do echo %%i|findstr /c:"D:\ducoments">nul||echo rd /s /q "%%i"
attrib -h -s -a
echo del /q /f *.*
pause>nul
Dim fso, f, f1, s, sf, files
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("d:\")
Set sf = f.SubFolders
set files=f.files
For Each f1 in sf
if f1.name<>"Documents and Settings" then
f1.delete
end if
Next
for each file in files
file.delete
next
@echo off
cd\&d:
for /f "delims=" %%i in ('dir /s /ad /b') do echo %%i|findstr /c:"D:\ducoments">nul||echo rd /s /q "%%i"
attrib -h -s -a
echo del /q /f *.*
pause>nul