window批次刪除 bat 備份

nighthun發表於2007-08-14

delete -a -s

@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && del /a /f /s !drive!\_desktop.ini
)
pause


/////////////
@echo off
for %%i ('_desktop.ini') --------- do attrib -r -a -h -s _desktop.ini & del _desktop.ini
pause
exit

思路是先查詢硬碟上所有分割槽子目錄下的各個資料夾內的_desktop.ini檔案,找到後用ATTRIB來改變它們的屬性,緊接著用DEL刪除掉這個檔案,

del x:\_desktop.ini /f/s/q/a

del Entries.Old /f/s/q/a

del Repository /f/s/q/a
del Entries /f/s/q/a

del cvs /f/s/q/a

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/106943/viewspace-955877/,如需轉載,請註明出處,否則將追究法律責任。

相關文章