Force Map Network Drive with Local System Account

A client process kept failing because the mapped drive was randomly being lost. This fixed the issue by mapping the drive using the machines local service account.

You will need SysinternalsSuite to make this work.

1. Open an elevated cmd.exe prompt (Run as administrator)

2. Elevate again to root using PSExec.exe: Navigate to the folder containing SysinternalsSuite and execute the following command
psexec -i -s cmd.exe

You are now inside of a prompt that is nt authority\system .The -i is needed because drive mappings need to interact with the user

3. Create the persistent mapped drive as the SYSTEM account with the following command
net use P: \\servername\sharedfolder /persistent:yes

WARNING: You can only remove this mapping the same way you created it, from the SYSTEM account. If you need to remove it, follow steps 1 and 2 but change the command on step 3 to net use P: /delete.

NOTE: The newly created mapped drive will now appear for ALL users of this system but they will see it displayed as “Disconnected Network Drive (P:)”. It shows disconnected but it will work for everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *