ID: 6611

Print Friendly, PDF & Email

Mounting persistent network share as a drive letter on a Windows Server

If you need to configure a network share as a drive letter mounted volume on a Windows Server, it can be done. The key here is to ensure the drive letter is available before services started by Windows Service Control Manager (SCM) need it. Also, this drive has to be unmounted before shutdown. Here is a recipe tested by our support team:

  1. Create two batch files, one with a command to mount the network share and another to remove it. For example mount.bat and unmount.bat

    The command invoked in the script to mount as Z drive: net use z: \\essan.evolphinpoc\ES_SAN /user:Administrator Password /persistent:yes

    Please ensure the user name/password credentials allow read or write to the share from a Windows machine. Also, please ensure that a path is specified after the remote machine name/IP address. The mount is only created on a path to a folder.

  2. Similarly, unmount.bat will have script to remove the drive.

  3. Add the .bat files to a Windows Task setup to run at startup and shutdown respectively, using the “Create Task” menu option:

  4. Specify the full path to your batch file in the task action (“Start a program”).


  5. Configure the tasks to run at Windows startup without any logged in user:

  6. Run the batch scripts to ensure that the drive letter gets mounted and unmounted as desired.
  7. Or you can also, import the task from a preconfigured XML file click here to download the sample file. Please edit the file as follows:
    1. Rename file to mount.xml type from mount.txt.
    2. Change batch file path “C:\Users\John\Desktop\mount.bat” to batch file path specific to your system.
    3. Change the author tag “VANTAGE-RACK\John”.
    4. Change the description tag if you want to.
  8. Finally, reboot the Windows Server to allow the task to mount the share as a drive letter.

    You will notice that the mounted drive-letter shows as a “Disconnected” network drive in windows explorer. This seems to be just a Windows annoyance. The drive will still be accessible by all users.