I am trying to run this script:

Const CONVERSION_FACTOR = 1048576
Computer = "IT-Admin"
Set objWMIService = GetObject ("winmgmts://" & Computer)
Set colLogicalDisk = objWMIService.InstancesOf ("Win32_LogicalDisk.")
For Each objLogicalDisk In colLogicalDisk
FreeMegaBytes = objLogicalDisk.FreeSpace / CONVERSION_FACTOR
Wscript.Echo objLogicalDisk.DeviceID & " " & Int(FreeMegaBytes)
Next

Whenever I run it I get this error:

Script: {path to script}
Line: 5
Char: 1
Error: 0x80041010
Code: 80041010
Source: (null)

Can anyone tell me what this means and what I am doing wrong.

Re: Script Host Error by Michael

Michael
Wed May 07 17:50:00 CDT 2008

Pappy wrote:
> I am trying to run this script:
>
> Const CONVERSION_FACTOR = 1048576
> Computer = "IT-Admin"
> Set objWMIService = GetObject ("winmgmts://" & Computer)
> Set colLogicalDisk = objWMIService.InstancesOf ("Win32_LogicalDisk.")


try: objWMIService.InstancesOf ("Win32_LogicalDisk") 'not
"Win32_LogicalDisk."


> For Each objLogicalDisk In colLogicalDisk
> FreeMegaBytes = objLogicalDisk.FreeSpace / CONVERSION_FACTOR
> Wscript.Echo objLogicalDisk.DeviceID & " " & Int(FreeMegaBytes)
> Next
>
> Whenever I run it I get this error:
>
> Script: {path to script}
> Line: 5
> Char: 1
> Error: 0x80041010
> Code: 80041010
> Source: (null)
>
> Can anyone tell me what this means and what I am doing wrong.

--
Michael Harris