We help IT Professionals succeed at work.

Check mapped drive on another computer

Jameseka asked
To obtain all the map drive in the computer I would physically go to that computer run net use  > mapping.txt,  Then I would copy or print out the txt file.

Today I recive a task to check all the mapping drive for 200 computers. Can I achive this  remotely?
I have local administrator to all this 200 computer but i do not have domain administrator right.

Is there a way to achive this without installing a third party program in those client?

There is no firewall or proxy server.
The network in internal network which i could ping and they are all on the same segment.

Watch Question

it will be part of their user profile NTUSER.DAT on the server or if you have set it up using a group policy it should be generic for all users in a peraticular section


I do not have right to the server.
You mean I can map to the user c: \\computername\c$ and copy ntuser.dat to retive the information.

The implementation is also not a standard group policy so i need to manually complie the information manually

Is there any administrator tools that I can install in my XP professional computer ,
or something like netsh command that I can query the information remotelly
you need domain admin rights to be able to automate this kind of procedure


This is not what I am look for as stated on the initial question.
Most Valuable Expert 2011
Top Expert 2011

I am no a scripter, but Mapped drives are stored in the registry (user created mappings, not login script based mappings), under HKEY_USERS\{SID}\Network, and HKEY_CURRENT_USER\Network. Maybe someone can assist in creating a script for this?


Will do some research in the registry key.
If can find the answer will award some point for speed up my research process.

Mean time hopfully someone can provide me a more direct answer to this problem.


HI john
Open the remotelly computer can only see hkey_users and hkey_local machine.
Cannot open hkey_local machine.
Did a search on hkey_users cannot find any usefully values.
The solution did not work.

I am sorry I don't have time to write and test a script for you, but I can point you in the right direction.

Using VBSCripting you should be able to use WMI and an array of computer names to get the information.  I believe the WMI property is win32_logicaldisk.  Still you need to have root access to each system (I am not sure if local admin cuts it, domain admin most definately does).  

What I would do is create a list of systems, one on each line) of a text file.  Then create some logic that "splits" the readall into an array.  Then for each element of the array I would collect a list of their drives using win32_LogicalDisk's DriveType property (a "4" means it is a network drive).

Here is a link to the msdn info on Win32_LogicalDisk: http://msdn2.microsoft.com/en-us/library/aa394173(VS.85).aspx


Hi sr75
Seem like the only way is to write script which I find it quite hard
Just leave this question open hopefully got a easy way to perform this task.
Thanks for you suggestion
It really isn't that hard.  Here is a script I have used in the past to collect all the mapped drives and store them locally on the system.   You can make some simple adjustments to have them save it to a network share and run it as a logon script.   It would only take a little more complex scripting to (using an array) to actually turn it into something you can run from your system and probe the rest of the network.
On Error Resume Next
strComputer = "."
arrDriveType = array("Unknown",_
		     "No Root Directory",_
		     "Removable Disk",_
		     "Local Disk",_
		     "Network Drive",_
		     "Compact Disk",_
		     "RAM Disk")
set WMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colDisks = WMI.ExecQuery("Select * from Win32_LogicalDisk")
For Each Disk in ColDisks
	strType = arrDriveType(Disk.DriveType)
	strID = Disk.DeviceID
	strSys = Disk.SystemName
	If strType = "Network Drive" then
		strPath = Disk.ProviderName
		List = List & "   " & strID & vbtab & vbtab & strPath & vbcrlf
	End If
strHeader = "A List of Mapped Drives" & vbcrlf & vbcrlf &  _
	"Drive Letter" & vbtab & "Share Path" & vbcrlf & _
	"------------------------------------" & vbcrlf 
List = StrHeader & List 
'     Document Mapped Drives
Function func_CreateDoc(List)
	Set FSO = CreateObject("Scripting.FileSystemObject")
	strFolder = "C:\ScriptLogs" 
	If FSO.FolderExists(strFolder) = false then
		CLog = FSO.CreateFolder(strFolder)
	End If
	ShareFile =  strFolder & "\MappedDrives.txt"
	Set LogFile = FSO.OpenTextFile(ShareFile, 2, True)
		Logfile.Write List
End Function

Open in new window


With this strructure it should provide me some clue to work on


Hi sr75
Is a quite long since I complie a code. Always use third party program.
Can I ask how you complie this code so I can run it.
If I can compile it i could try with the differnt object class.

there is no compiling.  Copy and paste it into notepad and save it with the .vbs extension.  It will run like a dos batch script does.


ok thanks again

Explore More ContentExplore courses, solutions, and other research materials related to this topic.