Program Your Windows XP to Heal itself
Ever experience disk failure to the point your PC needs a new hard disk? Well, you should blame nobody except yourself for most of the times you cant remember to do the routinary task in checking your disk.
You can teach your Windows XP to automate all the process by itself, all you need is a simple batch script that takes disk maintenance to the next level by checking all your hard drives for errors, repairing any it finds, and then defragmenting.
Originally written by Ted Laun at TechRepublic and with slight modification, this DiskChecker script does the following for all the drive letters you specify:
* Using Windows utility dskchk, checks the disk for errors.
* If errors are found, repairs them and defrags.
* If the drive is a boot disk, sets chckdsk to repair errors after the next reboot and defragments the drive optimized for booting.
Here’s how to get the DiskChecker script set up.
1. Copy this script and save it with file name DiskChecker.bat
REM chkdsk and defrag automation
for /F “eol= tokens=1 delims=( ” %%i in (DrvLtr.txt) do set DrvLtr=%%i& call :dsKchk
:dsKchk
If %DrvLtr% == end goto :eof
chkdsk %DrvLtr%
If not errorlevel 3 goto :defrag
If not exist %DrvLtr%\winnt If not exist %DrvLtr%\windows If not exist %DrvLtr%\pagefile.sys goto :dskchkon
:dskchkoff
cd\
%DrvLtr%
echo Y | chkdsk /F /R
goto :defrag
:dskchkon
chkdsk %DrvLtr% /F /R
:defrag
cd\
%DrvLtr%
defrag %DrvLtr% -b
defrag %DrvLtr%
:EOF
2. Create a new text file called DrvLtr.txt. List all the hard drives on your system you want checking, one per line. Then make the last line read, “end.” For example, my DrvLtr.txt file looks like this:
C:
D:
G:
end
3. Save DrvLtr.txt to the same directory where you saved DiskChecker.bat.
Now, to schedule DiskChecker to run regularly, from
Control Panel,
open Scheduled Tasks.
From the File menu,
choose New > Scheduled Task,
and name the task “Disk Checker.”
In the Run: field, enter the full location of DiskChecker.bat. Mine reads: “D:\*\DiskChecker.bat.”
Caution: Please consider that the dskchk when runs at startup completely makes your PC unusable until it finish its task, and that can be a long time for larger disks so be sure to schedule the reboot well before you’ll need your computer to get work done.
www.dinamiczone.com

May 27th, 2008 at 10:31 pm
[...] yourself for most of the times you cant remember to do the routinary task in checking your diskhttp://www.exerliving.com/archives/43Amazon.com: Doing Hard Time: Boris Kodjoe, Michael K. Williams …Amazon.com: doing hard Time: Boris [...]