Blog"Lees hier meer over onze laatste oplossingen op ICT gebied"

How to get rid of disconnected network drives

19 november, 2013 at 11:12 AM

 

This week is wrote a script that created a mapping to another domein.

I compliled the script to an exe en created a service that started this exe with another username.

  • After I was playing around with that script I notice Disconnected Network Drive (V:)
    When I tried to remove this Disconnected Network Drive (V:) The network connection could not be found.

 

I tried:

1)  net use /delete *

 

2)  and script.

@echo off
net use * /delete /y
taskkill /f /IM explorer.exe
explorer.exe

3)       Mounting a share to this drive.

4)       Remove froom registry

To remove the incorrectly labeled mapped drive, follow these steps:

  • Click Start, point to Run,      type regedit, and then click OK.
  • In Registry Editor, locate the      following registry subkey:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2

  • Right-click      the mapped drive that you want to remove. For example,
    right-click ##Server_Name#Share_Name,      and then click Delete.

 

Then my colleague had a brilliant idee:

Use psexec!

The mapping was originally created by the user system, so you have to remove them under the system account.

Psexec uses the system account.

 

psexec \\remote -u domain\account -p passwd -e cmd.exe

net use /delete *


or


psexec \\remote -u domain\account -p passwd cmd.exe

net use /delete *

 

 

 

 

 

 



Labels:
Categorie:

Commentaar

Keer terug naar het overzicht

Contactinformatie

ICTwijs

Achter 't Holthuis 34

7391 TN Twello

Tel: 06 - 38812310

E-mail: info@ictwijs.nl

Teruggebeld worden?

Indien u teruggebeld wilt worden kunt u hieronder uw telefoonnummer achterlaten. Wij zullen dan zo spoedig mogelijk contact met u opnemen.

Offerte & Informatie

Een geheel vrijblijvende offerte of meer informatie aanvragen behoort ook tot de mogelijkheden. Vul hiervoor ons contactformulier in.