I mapped a network drive under local system account, I mean I login to my machine using local sytem account. Now I logged off and logged into the machine again using some other valid user account, but I couldn't find that mapped drive in my computer explorer, though am able to use that mapped drive in my application. Is this normal?

Is there any way to see all mapped network drives on my system?

I am on a Windows XP machine.

  • 1
    How – and more importantly, why – did you log in as Local System? – user1686 Feb 22 '11 at 14:05

Yes, it's normal. Network connections and drive letters assigned to them are session-local. Normally they disappear upon logout (when the session itself is destroyed) and are re-created by Winlogon when you log in again.

With Local System it gets confusing, though.

Log in as Local System again (psexec -desi cmd may be useful), then run net use to list all connections or net use * /delete to disconnect them.

> net use

is what you need. See this for more info.

  • yaa i already done that but could n't find mapped drive that i able to use... – AMIT Feb 22 '11 at 8:31
  • net view lists available shares on a server, not active connections. – user1686 Feb 22 '11 at 14:09
  • @grawity: Of course, you're right... I meant the net use command (I updated my answer) – fretje Feb 22 '11 at 15:52

I grab mapped drives from a remote machine using powershell as part of a script to move their settings to a persons' new machine: (set $OldComputer to the name or IP of the old computer) It goes through the list of all drives on the remote system, and if they are not local drives, it will attempt to remove that drive mapping on the current computer (in case its used by something else) then remap it. Comment out the second to last line (the one above foreach, and add your own line to log or msgbox if you want.)

$netObj = New-Object -com wscript.Network
$WMI1 = [WMISearcher] "Select Name, Providername from win32_mappedLogicalDisk"
$WMI1.Scope.path="\\" + $oldComputer + "\root\cimv2"
$ColDrives = $WMI1.Get()

foreach ($objDrive in $colDrives) {
      $TestLocal = get-wmiObject Win32_LogicalDisk | ? {$_.DeviceID -eq $objDrive.Name} | % {$_.Providername}
      If ($TestLocal) {
        Net Use /Delete $objDrive.Name >> $LogFile
      #Map the drive
      Net use $objDrive.Name $objDrive.ProviderName  >> $LogFile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.