Script to defrag C: drive

Windows operating systems prior to Vist and Server 2008 didn’t have the functionality of easily scheduling a defrag job from the GUI. Using the script below you can create a scheduled task to regularly defragment your disks.

I recommend using it to accompany the

'*Script Name:	Defrag.vbs
'*Created on:	16/03/2012
'*Author:	Tom Anderson
'*Purpose:	This script defragments the C: drive. Ammend the text if other drives are required.

Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd.exe /c defrag.exe C:"
Posted in Guides Tagged with: ,
0 comments on “Script to defrag C: drive
1 Pings/Trackbacks for "Script to defrag C: drive"
  1. […] creating a scheduled task. Several times I have created a task that runs 30 minutes before the Defrag script, this helps to keen your hard disk clear and […]

Leave a Reply

Your email address will not be published. Required fields are marked *