2

Mapped network drives on Windows are not visible to programs running "As Administrator". I can open an admin command prompt and map the drive with net use Z: //server/share /persistent:yes, but it will be gone after a reboot, ignoring /persistent:yes.

I have tried settings HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLinkedConnections to DWORD 1, but it does nothing.

How can I permanently map a drive letter to a network path for a program that needs to run as Administrator?

Tor Klingberg
  • 623
  • 2
  • 8
  • 17
  • This sounds like a 2 step process? Step 1, map a drive. Step 2. Run program with admin rights. So lets go with basics. [1] Can you map other drives besides the Z:, in other words, can you make other map drives that are persistent, or is it only the Z: that does not survive after a reboot? [2] Can your program work with UNC paths? If so, can you modify #2 to work with UNC's? – bvaughn Sep 12 '16 at 14:34
  • [1] It doesn't matter which letter I use. I can map drives for admin, but they are all gone after a reboot. [2] No, the program is Visual Studio, which does not work well with UNC paths. – Tor Klingberg Sep 12 '16 at 15:02
  • [1A] for the map drive do you log in as a regular user and then elevate later for the admin rights, or do you log in as a admin user? [1B] Have you tried making a net use bat file, and then putting it into the task scheduler with a run after log on. (maybe with a timeout /t 3 for a brief pause ) [2A] Can you make a shortcut to a bat file for launching Visual studio. In it, put a net use to load up the mapped drive, then a pause, and then continue on to starting visual studio. – bvaughn Sep 12 '16 at 15:18
  • I log in to my own account, which is an Administrator account. Then I start VS or a command prompt by right clicking and choosing "Run as administrator". I will try the task scheduler with a bat file. I hoped there would be a "better" solution. – Tor Klingberg Sep 12 '16 at 15:34
  • if the bat file works, there are some further options if not happy. Still in TS as to what is going on. – bvaughn Sep 12 '16 at 15:53
  • I am trying to schedule a bat file, but I cannot get it to run as administrator. It just maps the drive on my user account. – Tor Klingberg Sep 12 '16 at 16:24
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/45279/discussion-between-bvaughn-and-tor-klingberg). – bvaughn Sep 12 '16 at 17:42

0 Answers0