Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repairing a "disconnected" windows drive mapping

Sometimes a network drive that is already mapped to a drive letter because "disconnected". Using the normal Windows functions to access files / folders on that drive fail. As soon as the user manually clicks on that drive it the Windows Explorer dialog, it's magically repaired.

Since my program is a batch program I'd like to start this "magic" from my program (C++) but I haven't found a Windows function for that. There's nothing in the usual WNet... functions...

like image 790
user178379 Avatar asked Nov 06 '22 19:11

user178379


1 Answers

NET USE V: /DELETE
NET USE V: "\\server1\videos"

NET USE L: /DELETE
NET USE L: "\\server2\archive"
like image 86
Mitchell Skurnik Avatar answered Nov 15 '22 00:11

Mitchell Skurnik