Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows XP 全自動維護腳本:INF + BAT 實現磁碟重組、檢查、關機一條龍

編輯:XP 系統應用技巧

利用 .inf 安裝腳本呼叫批次檔,打造零成本自動維護:

核心檔案

C:\Main.bat

cd\
C:
cd Windows\System32
defrag C: /f
chkntfs C:

C:\Main.inf

[Version]
Signature="$CHICAGO$"
AdvancedINF=2.5,"advpack.dll"
[DefaultInstall]
RunPreSetupCommands=Tst.PreSetup
RunPostSetupCommands=Tst.PostSetup
[Tst.PreSetup]
C:\Main.bat
[Tst.PostSetup]
C:\Windows\System32\TSSHUTDN.EXE 0 /DELAY:0 /POWERDOWN

執行方式

rundll32.exe advpack.dll,LaunchINFSection C:\Main.inf,DefaultInstall

可放入「排程工作」每週自動執行。Main.bat 內容可擴充為 xcopy 備份、del 清理、wuauclt /detectnow 更新檢查等任意維護指令組合。

Copyright © Windows教程網 All Rights Reserved