Monday, May 23, 2011

Easy Scheduling with UltraDefrag

During a regular use of your PC hard disk continuously accumulates with fragmented files. This affects the system speed as fragmented file utilize more time to load on system. The solution for that is to defragment the disk.

UltraDefrag is an excellent piece of work which optimize the hard disk for performance. Its command line options allows you to select the folders to be defragmented. Through this ulitly we can perform a regular defragmentation of folders and paths which are in constant use. The recommended settings for Scheduled Disk Defragmentation is provided by the author.

For Precise installation of the sample recommended Scheduling please visit the article at PC Starters wiki

http://ultradefrag.sourceforge.net/handbook/Schedule.html

With the help of vbs script we can hide the cmd window and make the defragmentation process to run silently in background.
VBS SCRIPT
The vbs script goes like this:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Path\to\file\defrag-?????.bat" & Chr(34), 0
Set WshShell = Nothing

CREATE BATCH FILE
Create four bat file

defrag-browserdata.bat:

cmd.exe /C "set UD_IN_FILTER="%APPDATA%\Mozilla" && udefrag %APPDATA%"


(this is only when you have Google Earth Installed)defrag-earth.bat:

cmd.exe /C "set UD_IN_FILTER="%APPDATA%\Google\GoogleEarth" && udefrag %APPDATA%"


defrag-{often_accessed_folders}.bat

cmd.exe /C "set UD_IN_FILTER="%often_accessed_folders%" && udefrag --wait --all-fixed"

({Often_accessed_folders} = Is the location in which you keep your documents, music and video stuff. Mostly all user data is stored in user profile(C:\Users\username or C:\Documents and Settings\username in xp) so u can directly use %userprofile% and system will locate ur profile.)

defrag-system.bat:

cmd.exe /C "set UD_EX_FILTER="system volume information;temp;recycle;.zip;.7z;.rar" && set UD_SIZELIMIT=100M && udefrag --wait --all-fixed"

CREATE VBS FILE
After creating them create four .vbs file with same name. That is

defrag-browserdata.vbs
defrag-earth.vbs
defrag-{often_accessed_folders}.vbs
defrag-system.vbs

Copy the above vbs script to each vbs file. And rename the batch executive name with respective vbs and save it.

SCHEDULING
To learn about Scheduling go to
Windows XP: http://support.microsoft.com/kb/308569
Windows Vista/7: http://windows.microsoft.com/en-US/windows-vista/Schedule-a-task

Schedule the four in following manner

defrag-browserdata.vbs : every 30 minutes
defrag-earth.vbs : everyday
defrag-{often_accessed_folders}.vbs : every week
defrag-system.vbs : every two months

This scheduling would easily maintain your hard disk performance without hassle.

No comments:

Post a Comment