Mapping network drive using WNetAddConnection2 from “Run As Administrator” process does not work
问题 I have an application which calls WNetAddConnection2 to map a network drive. This works perfectly unless I run the application as Administrator (right click - Run As Administrator) in which case the function returns 0 (success) but the mapped drive does not appear. What seems to be happening here is that there are two Contexts , the Admin one in which my program is running and the user one in which windows explorer is running and I am looking for the mapped drive. I think the drive mapping is