Listing mapped drives on remote computers



I have the following script:
strComputer = InputBox("What is the computer name:")

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colDrives = objWMIService.ExecQuery _
("Select * From Win32_LogicalDisk Where DriveType = 4")

For Each objDrive in colDrives
Wscript.Echo "Drive letter: " & objDrive.DeviceID
Wscript.Echo "Network path: " & objDrive.ProviderName
Next

This will list the mapped drives on our W2K machines, but not the XP computers. What change do I have to make so it will work on both?

Thanks,
Jody
.



Relevant Pages

  • Re: Search for and output users mapped network drives
    ... Has anyone got a script to run on Windows 2000/XP machines so when a user ... logs on it scans for any mapped drives they have and outputs this ... to use the Win32_LogicalDisk WMI class to enumerate all the mapped drives. ...
    (microsoft.public.scripting.vbscript)
  • Re: Best Method for Mapping Drives (XP/2000)
    ... At my work-place we have 95% XP-sp2 machines and the rest Windows 2000 Pro machines. ... Before we had any XP machines, we had a batch program that would remove all mapped drives, then reassign them. ... Run the script everytime, or only run the script once and let XP remember for the rest of the time? ...
    (microsoft.public.windowsxp.general)
  • Script does not run in certain cases
    ... I have a VB script that is called from a batch file on logon to rename ... mapped drives. ... On some machines, mostly on dual ...
    (microsoft.public.scripting.vbscript)
  • Cannot rename mapped network drives, ...sometimes
    ... I have a VB script that is called from a batch file on logon to rename ... mapped drives. ... On some machines, mostly on dual ...
    (microsoft.public.scripting.wsh)
  • Re: Search for and output users mapped network drives
    ... Has anyone got a script to run on Windows 2000/XP machines so when a user ... logs on it scans for any mapped drives they have and outputs this ... article on Microsoft's website that shows how to use the Win32_LogicalDisk WMI class to enumerate all the mapped drives. ...
    (microsoft.public.scripting.vbscript)

Loading