Is there a command that can be used from the command line to output a list of the mapped network drives on the local system and their location on the network to a txt file? This will only be used on Windows-based systems running XP.

link|improve this question
feedback

2 Answers

up vote 8 down vote accepted

net use > mapped_drives.txt should dump a list of mapped drives to the text file mapped_drives.txt

alt text

Although I tested this on Windows 7, Microsoft says net use will work on Windows XP

link|improve this answer
Simple, and it works. Thanks! – user35406 Apr 29 '10 at 1:47
@MaterialEdge : Welcome! – Sathya Apr 29 '10 at 2:20
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown