
如何使用 Microsoft 資源工具包實用程式 Delprof.exe 刪除舊設定檔(超過 30 天)而不刪除本機管理員帳戶?
delprof.exe /Q /C:\\遠端電腦 /D:30
這已經差不多了,但我想跳過本機管理員帳戶。另外,請安靜地執行此操作,不要提示每個帳戶。
答案1
對於沉默部分,字母“I”可能會滿足您的需求:
Microsoft(R) Windows (R) 2000 Operating System User Profile Deletion Utility v5.
00
Copyright (C) Microsoft Corp. 1981-1999
This utility deletes Windows NT and Windows 2000 user profiles.
usage: DELPROF [/Q] [/I] [/P] [/C:\\<computername>] [/D:<days>]
/Q Quiet, no confirmation.
/I Ignore errors and continue deleting.
/P Prompts for confirmation before deleting each profile.
/C Remote computer name.
/D Number of days of inactivity.
但也看看http://www.wisesoft.co.uk/scripts/vbscript_delete_local_profiles.aspx它做同樣的事情,但不使用 delprof 並且您可以跳過某些使用者設定檔。
如果您正在使用漫遊設定檔並且根本不希望保留它們,請考慮在 GPO 中使用“刪除漫遊設定檔的快取副本”,可以在以下位置找到:
Computer Config > Admin Template > User Profiles > Delete Cached copies of roaming profiles
儘管眾所周知它會在無線網路等上失敗,因此經常運行 delprof 或其他腳本來捕獲這些問題可能仍然是個好主意。
答案2
尚未嘗試過,但您可能必須更新要保留的設定檔。它不是很健壯,但可以使用 REG LOAD 來完成,然後添加、刪除和卸載。