Answers:
net use > mapped_drives.txt
应该将映射驱动器列表转储到文本文件 mapped_drives.txt
尽管我在Windows 7上进行了测试,但微软表示 net use
可以在Windows XP上运行
将以下内容另存为.vbs文件并运行。它将在运行vbs文件的文件夹中创建一个MappedDrives.txt。您可以将strComptuer替换为另一台计算机的名称,并将列表也从远程计算机上删除。
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