Skip to main content
Please don't use acronyms like HTH, the reputation will show you if it worked...
Source Link
Tamara Wijsman
  • 57.5k
  • 28
  • 188
  • 256

Save the following as a .vbs file and run it. It'll create a MappedDrives.txt in the folder the vbs file is run from. You can replace the strComptuer with another computer's name and get the list off of a remote computer as well.

strComputer = "."

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

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutFile = objFSO.CreateTextFile(".\MappedDrives.txt")

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

For Each objDrive in colDrives
    objOutFile.WriteLine(objDrive.DeviceID & " (" & _
      objDrive.ProviderName & ")")
Next

objOutFile.Close

HTH

Save the following as a .vbs file and run it. It'll create a MappedDrives.txt in the folder the vbs file is run from. You can replace the strComptuer with another computer's name and get the list off of a remote computer as well.

strComputer = "."

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

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutFile = objFSO.CreateTextFile(".\MappedDrives.txt")

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

For Each objDrive in colDrives
    objOutFile.WriteLine(objDrive.DeviceID & " (" & _
      objDrive.ProviderName & ")")
Next

objOutFile.Close

HTH

Save the following as a .vbs file and run it. It'll create a MappedDrives.txt in the folder the vbs file is run from. You can replace the strComptuer with another computer's name and get the list off of a remote computer as well.

strComputer = "."

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

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutFile = objFSO.CreateTextFile(".\MappedDrives.txt")

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

For Each objDrive in colDrives
    objOutFile.WriteLine(objDrive.DeviceID & " (" & _
      objDrive.ProviderName & ")")
Next

objOutFile.Close
Source Link
Ƭᴇcʜιᴇ007
  • 113.2k
  • 19
  • 203
  • 270

Save the following as a .vbs file and run it. It'll create a MappedDrives.txt in the folder the vbs file is run from. You can replace the strComptuer with another computer's name and get the list off of a remote computer as well.

strComputer = "."

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

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutFile = objFSO.CreateTextFile(".\MappedDrives.txt")

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

For Each objDrive in colDrives
    objOutFile.WriteLine(objDrive.DeviceID & " (" & _
      objDrive.ProviderName & ")")
Next

objOutFile.Close

HTH