Hello Team, Greeting All!
My aim is to retrieve the list of mapped drives in users computer. I am using the below code to achieve this, When I use my vbscript with user account it works, whereas if I run the same in system account, it didn't work for me. Could you help me out this..
---------------------------------------------------------------------------------------------------------------------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colDrives = objWMIService.ExecQuery _
("Select * From Win32_LogicalDisk Where DriveType = 4")
For Each objDrive in colDrives
ObjLogfile.write objDrive.DeviceID
ObjLogfile.write " " & objDrive.ProviderName & vbCrLf
Next
---------------------------------------------------------------------------------------------------------------------------------------------
Thanks for your help in advance!!
Regards,
-RC