Hello,
Recently I used the class Win32_Logicaldisk to list all mapped network
drives and found an issue.
For unknown reason some network drives are shown when I run NET USE,
but do not shown when I look for them via a Win32_Logicaldisk
collection.
Here is the output:
*****************************
C:\>net use
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
Unavailable K: \\deimos\temp Microsoft Windows
Network
Disconnected R: \\sun\netlogon Microsoft Windows
Network
Disconnected Z: \\sun\c$ Microsoft Windows
Network
The command completed successfully.
C:\>cscript /nologo netdisk.vbs
Drive letter: R:
Drive letter: Z:
*****************************
Here is the netdisk.vbs, very simple, isn't it?
*****************************
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colDrives = objWMIService.ExecQuery("Select * From
Win32_LogicalDisk Where DriveType=4")
For Each objDrive in colDrives
Wscript.Echo "Drive letter: " & objDrive.DeviceID
Next
*****************************
Have anyone had this problem before?
Why it does not work?
Thak you for any ideas