備份: xcopy \\server\bak\*.* d:\serverbak /s /e /v /c / d /y /h 說明: xcopy命令參數(shù)可以用xcopy/?查看 at 05:30 shutdown -s -f 表示5:30分自動(dòng)關(guān)機(jī) 刪除三天前的文件 forfiles /p i:\serverbak\2005 /s /m *.* /d -2 /c "cmd /c del @file" 說明:forfiles是2003自帶的命令,非常好用,詳細(xì)可以forfiles/?查詢??梢詮?fù)制到XP中使用,復(fù)制到2000中測試失敗。郁悶中。(百度不能插附件,把forfiles此文件加到底下圖片中去了,另存圖片后改后綴名.jpg為.rar即可得到forfiles文件) forfiles: /p 指定的路徑
默認(rèn)命令是 "cmd /c echo @file"。下列變量 示例 forfiles /p c:\ /s /m*.bat /c"cmd /c echo @file is a batch file" 要列出驅(qū)動(dòng)器 C: 上的所有目錄,請(qǐng)鍵入: forfiles /p c:\ /s /m*.* /c"cmd /c if @isdir==true echo @file is a directory" 要列出驅(qū)動(dòng)器 C: 上存在時(shí)間多于 100 天的所有文件,請(qǐng)鍵入: forfiles /p c:\ /s /m*.* /dt-100 /c"cmd /c echo @file :date >= 100 days" 要列出驅(qū)動(dòng)器 C: 上 1993 年 1 月 1 日以前創(chuàng)建的所有文件,而且對(duì)于日期早于 1993 年 1 月 1 日的文件顯示“file is quite old!”,請(qǐng)鍵入: forfiles /p c:\ /s /m*.* /dt-01011993 /c"cmd /c echo @file is quite old!" 要按列格式列出驅(qū)動(dòng)器 C: 上所有文件的擴(kuò)展名,請(qǐng)鍵入: forfiles /p c:\ /s /m*.* /c "cmd /c echo extension of @file is http://www.qqstock.cn/" With: 要列出驅(qū)動(dòng)器 C: 上的所有批處理文件,請(qǐng)鍵入: forfiles /p c:\ /s /m *.bat /c "cmd /c echo @file is a batch file" 要列出驅(qū)動(dòng)器 C: 上的所有目錄,請(qǐng)鍵入: forfiles /p c:\ /s /m *.* /c "cmd /c if @isdir==true echo @file is a directory" 要列出驅(qū)動(dòng)器 C: 上存在時(shí)間多于 100 天的所有文件,請(qǐng)鍵入: forfiles /p c:\ /s /m *.* /d t-100 /c "cmd /c echo @file :date >= 100 days" 要列出驅(qū)動(dòng)器 C: 上 1993 年 1 月 1 日以前創(chuàng)建的所有文件,而且對(duì)于日期早于 1993 年 1 月 1 日的文件顯示“file is quite old!”,請(qǐng)鍵入: forfiles /p c:\ /s /m *.* /d t-01011993 /c "cmd /c echo @file is quite old!" 要按列格式列出驅(qū)動(dòng)器 C: 上所有文件的擴(kuò)展名,請(qǐng)鍵入: forfiles /p c:\ /s /m*.* /c "cmd /c echo extension of @file is http://www.qqstock.cn/" |
|