Restore Disconnect Disk Mapping

Sometimes a network drive that is already mapped to a drive letter is "mapped". Using normal Windows functions to access files / folders on this drive fails. As soon as the user manually clicks on this disk the Windows Explorer dialog box, it is magically restored.

Since my program is a batch program, I would like to start this β€œmagic” from my program (C ++), but I did not find a Windows function for it. There is nothing in ordinary WNet functions ...

+3
source share
7 answers
NET USE V: /DELETE
NET USE V: "\\server1\videos"

NET USE L: /DELETE
NET USE L: "\\server2\archive"
+1
source
+1

net use:

net use \\server\folder [/user:[domain\]username] [password]

, net use /delete , .

0

WNetAddConnection WNetAddConnection2?

0

, . Explorer, , - . , Explorer , , . , regmon , , .

0

. , , , , . MSKB 297684 .

0

CMB, . ( ) , .

, m:\pathonserver, \server\c\pathonserver.

, , :.\Blahdeblah.dat \\\blahdeblah.dat

UNC- , Windows , .

0

Source: https://habr.com/ru/post/1718451/


All Articles