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 ...
NET USE V: /DELETE NET USE V: "\\server1\videos" NET USE L: /DELETE NET USE L: "\\server2\archive"
, , , , WNetGetConnection(), .
WNetRestoreConnectionW(), , , , .
net use:
net use
net use \\server\folder [/user:[domain\]username] [password]
, net use /delete , .
net use /delete
WNetAddConnection WNetAddConnection2?
, . Explorer, , - . , Explorer , , . , regmon , , .
. , , , , . MSKB 297684 .
CMB, . ( ) , .
, m:\pathonserver, \server\c\pathonserver.
, , :.\Blahdeblah.dat \\\blahdeblah.dat
UNC- , Windows , .
Source: https://habr.com/ru/post/1718451/More articles:ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ Π²Ρ ΠΎΠ΄ Π² CakePHP - authenticationHide content in view mode based on controller authorization filters - asp.net-mvcΠΠΎΡΡΠ΄ΠΎΠΊ Π·Π°Π³ΡΡΠ·ΠΊΠΈ JAR Π²Π½ΡΡΡΠΈ EAR APP-INF/lib - javaHow to access an item through another item using Watir? - internet-explorerError handling (for example, OutOfMemoryError) on servers - javaBlocking Strategy with PropertyChangeListener - javaΠΠ°ΠΊΠΎΠ²Ρ Π½Π°ΠΈΠ»ΡΡΡΠΈΠ΅ ΠΌΠ΅ΡΠΎΠ΄Ρ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ Π΄Π»Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΈ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ Π²Π΅ΡΡΠΈΠΉ JRE? - javaHow to remove non-unique lines from a large file using Perl? - perlIs malloc / new return memory blocking cache or RAM? - c ++Table overflow handling - htmlAll Articles