Im trying to get some info on what drives are mapped for users that are currently logged on.

here is the script which works fine when im logged in but when i change the STRCOMPUTER = "Name of computer" it dont work.

Can someone help me out please.



strComputer = "."

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