星期四, 4月 10, 2008

備份windows user profile

---------這裡開始,以下內容貼到backup.cmd中----------------
cd "\Documents and Settings\"
echo ntuser > tmp.txt
echo usrclass >> tmp.txt
echo tmp >> tmp.txt
echo temp >> tmp.txt
echo Cookies >> tmp.txt
echo History >> tmp.txt
xcopy /ehrkcy /exclude:tmp.txt user1\* user1_backup\
del tmp.txt
--------到這裡結束-----------------------------------------------------------
說明:
/exclude 排除tmp.txt內所列之檔案
tmp.txt 為臨時的檔案,內容為要排除的檔案清單,只要目錄檔名中有部份符合的字串就會排除
/ehrkcy 等於 /e /h /r /k /c /y
/e 子目錄含空目錄
/h 含系統檔、隱藏檔
/r 覆蓋唯讀檔
/k 還原唯讀檔的唯讀屬性
/c 遇到錯誤後繼續不要中斷
/y 覆蓋檔案前不詢問

沒有留言: