I got this script from the Microsoft Script Center
----------------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colVolumes = objWMIService.ExecQuery _
("Select * from Win32_Volume Where Name = 'D:\\'")
For Each objVolume in colVolumes
errResult = objVolume.Defrag()
Next
------------------------------------------
However when I try to run the script I get the error:
Line: 8
Char: 1
Error: 0x80041010
Code: 80041010
Source: Null
Any Ideas about getting this script to run? What I'm tring to do is
create a .hta that will defrag the hard-drive (and other things).