Windows Vista Forums

WMI VBSCRIPT error 0x80041001

  1. #1


    Axel Guest

    WMI VBSCRIPT error 0x80041001

    The following script runs fine on SBS2003 and Vista Business. The script fails with error code 0x80041001 on XP Pro 64-bit, leading me to believe the problem is either a 64-bit compatibilty issue, a corrupted WMI on the XP machine, or a VBScript implementation issue. All machines have the latest service packs and hotfixes installed.

    --------------------------------------------------------------------------------

    WScript.Echo "Using Win32_LogicalDisk object"
    Set LDiskSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_LogicalDisk")
    for each LDisk in LDiskSet
    if LDisk.DriveType=3 then
    WScript.Echo "-------------------------------------------------------------------------"
    if isnull(LDisk.DeviceID) then
    WScript.Echo "DeviceID is NULL"
    else
    WScript.Echo "DeviceID: " + LDisk.DeviceID
    end if
    if isnull(LDisk.Caption) then
    WScript.Echo "Caption is NULL"
    else
    WScript.Echo " Caption : " + LDisk.Caption
    end if
    if isnull(LDisk.FileSystem) then
    WScript.Echo "FileSystem is NULL"
    else
    WScript.Echo " FileSystem: " + LDisk.FileSystem
    end if
    if isnull(LDisk.Size) then
    WScript.Echo "Size is NULL"
    else
    WScript.Echo " Size: " + formatnumber(LDisk.Size/(1024*1024),0) + " MB"
    end if
    if isnull(LDisk.VolumeName) then
    WScript.Echo "VolumeName is NULL"
    else
    WScript.Echo " VolumeName : " + LDisk.VolumeName
    end if
    if isnull(LDisk.Name ) then
    WScript.Echo "Name is NULL"
    else
    WScript.Echo " Name : " + LDisk.Name
    end if

    if isnull(LDisk.SystemName ) then
    WScript.Echo "SystemName is NULL"
    else
    WScript.Echo " SystemName : " + LDisk.SystemName
    end if
    end if
    Next

    --------------------------------------------------------------------------------

    Can you tell me how to fix the problem?

    --
    Axel Larson
    ..


      My System SpecsSystem Spec

  2. #2


    Richard Mueller [MVP] Guest

    Re: WMI VBSCRIPT error 0x80041001

    Axel wrote:

    The following script runs fine on SBS2003 and Vista Business. The script
    fails with error code 0x80041001 on XP Pro 64-bit, leading me to believe
    the problem is either a 64-bit compatibilty issue, a corrupted WMI on the XP
    machine, or a VBScript implementation issue. All machines have the latest
    service packs and hotfixes installed.

    --------------------------------------------------------------------------------

    WScript.Echo "Using Win32_LogicalDisk object"
    Set LDiskSet =
    GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_LogicalDisk")
    for each LDisk in LDiskSet
    if LDisk.DriveType=3 then
    WScript.Echo
    "-------------------------------------------------------------------------"
    if isnull(LDisk.DeviceID) then
    WScript.Echo "DeviceID is NULL"
    else
    WScript.Echo "DeviceID: " + LDisk.DeviceID
    end if
    if isnull(LDisk.Caption) then
    WScript.Echo "Caption is NULL"
    else
    WScript.Echo " Caption : " + LDisk.Caption
    end if
    if isnull(LDisk.FileSystem) then
    WScript.Echo "FileSystem is NULL"
    else
    WScript.Echo " FileSystem: " + LDisk.FileSystem
    end if
    if isnull(LDisk.Size) then
    WScript.Echo "Size is NULL"
    else
    WScript.Echo " Size: " + formatnumber(LDisk.Size/(1024*1024),0) + " MB"
    end if
    if isnull(LDisk.VolumeName) then
    WScript.Echo "VolumeName is NULL"
    else
    WScript.Echo " VolumeName : " + LDisk.VolumeName
    end if
    if isnull(LDisk.Name ) then
    WScript.Echo "Name is NULL"
    else
    WScript.Echo " Name : " + LDisk.Name
    end if

    if isnull(LDisk.SystemName ) then
    WScript.Echo "SystemName is NULL"
    else
    WScript.Echo " SystemName : " + LDisk.SystemName
    end if
    end if
    Next

    --------------------------------------------------------------------------------

    Can you tell me how to fix the problem?

    ============
    After a quick glance the script looks OK, so WMI may be corrupt. The
    Win32_LogicalDisk class is supported by all OS's. What line (and statement)
    raises the error? I have discovered the following:

    1. You cannot connect to computer running XP Home.
    2. An NT computer cannot connect to OS later than W2k.
    3. A W2k3 computer cannot connect to Win9x.
    4. To connect to W2k Server SP4 you must set impersonation level to
    Impersonate.
    5. W2k computers must have SP2 to connect to XP or above.
    6. W2k3 can only connect to Win9x and NT if credentials supplied.
    7. To connect to XP or W2k3 you must set authentication level to Pkt.

    For best results in all situations, I use:

    strComputer = "pc_name"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
    & strComputer & "\root\cimv2")

    For troubleshooting I use the following links:

    http://www.microsoft.com/technet/scr.../help/wmi.mspx

    http://support.microsoft.com/kb/875605

    http://www.microsoft.com/technet/scr...es/wmifaq.mspx

    You can rebuild the WMI repository, if you have XP SP2, with the command:

    rundll32 wbemupgd, UpgradeRepository

    The following commands reinstall WMI in the registry:

    winmgmt /clearadap
    winmgmt /kill
    winmgmt /unregserver
    winmgmt /regserver
    winmgmt /resyncperf



      My System SpecsSystem Spec

WMI VBSCRIPT error 0x80041001

Similar Threads
Thread Forum
2738 vbscript error
I get this error when trying to uninstall weatherbug and Blackberry desktop manager. I have been able to uninstall other programs just fine. I...
General Discussion
Zip error using VBSCRIPT Error:Object not a collection
The error is in this part of code below. Object not a collection. The script still zips files but gives a msg error. I would appreciate anyone's...
VB Script
error CDO.Message - VBScript
hi, to see if I can help. I have the following script that until a few days ago it worked correctly. Has not touched any of the settings in...
VB Script
vbscript.dll error
When I try run: regsvr32 vbscript.dll The module "vbscript.dll" was loaded but the call to DllRegisterServer failed with error 0x80004005. What...
VB Script
vbscript error
when i try to unistall itunes get the error message itunes could not be installed because visual basic script (vbscript) is not installed or has...
Vista installation & setup
error 2738 vbscript
anything I try to install comes back with this message any ideas
Vista General
Itunes VBScript error. Please help!
I thank those of you who gave me an answer on my last post. I downloaded itunes now, and it gives me this error that vbscript is not enabled in my...
Vista music pictures video