Hi, does anybody know how I run chkdsk and immediately after that a defragmentation program (dirms) before XP starts or when it restarts? I know I can use Task Scheduler to schedule chkdsk at startup, but is it possible to run another program right after? I've read something about GuiRunOnce, but don't understand how to use it I want to make a batchfile that restarts my computer, at start up: 1.scans my harddrives for errors and fixes them,2.defrags my harddrives, (3. runs pagedefrag) and after that starts XP. EDIT: Finally figured it out Look here: http://www.msfn.org/board/index.php?showto...10entry254706