locked
Map Network drive auto connect for all Users RRS feed

  • Question

  • Hi,

    Need to connect Map Network drive auto connection for all the users (once its mapped in administrator login)

    Pls sugeest

    Server : Windows 2012 R2

    Workgroup

    Regards,

    Shahul Hameed

    Friday, February 2, 2018 11:50 AM

Answers

  • You could script it

    net use e: /delete
    net use e: \\myserv\myshare

    placed in;

    \ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

    folder for all users.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Marked as answer by ShahulFaizal Monday, February 5, 2018 5:11 AM
    Friday, February 2, 2018 3:04 PM

All replies

  • You could script it

    net use e: /delete
    net use e: \\myserv\myshare

    placed in;

    \ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

    folder for all users.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Marked as answer by ShahulFaizal Monday, February 5, 2018 5:11 AM
    Friday, February 2, 2018 3:04 PM
  • the below script worked for me

    net use X: \\sharefoldername password /user:username

    Thanks for your support Dave Patrick

    Monday, February 5, 2018 5:03 AM
  • You're welcome. Please mark answers if my reply was helpful.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Monday, February 5, 2018 5:05 AM
  • pls can you explain how to do this

    Monday, August 13, 2018 12:54 PM
  • Hi Dinukawk

    Using Notepad, copy the two lines above for the script.

    • The first line removes the mount, this is good if it's dropped or stuck
    • The second line reconnects it again:
    • "e:" can be any letter you want, that isn't in use
    • "\\sharefoldername" is the server you want to connect to
    • If the access requires a username and password different from the person logging in, then you need the extra two bits at the end; password and username
    net use e: /delete
    net use e: \\sharefoldername password /user:username

    Save as any name you want, but instead of ".txt" at the end use ".bat". If it still seems to be a text file then check if it hasn't just written ".bat.txt" and hidding it from you, see here for info on extentions: https://it.nmu.edu/docs/common-windows-file-extensions

    Then save the file in the Startup folder for all users. This location is different depending on the version of Windows.

    For Windows 7/8/10 this should be it:

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    You will need to be administrator to save to the folder. And Notepad might not like that. So instead, save the file somewhere else, them move it to the folder. Windows will then ask for admin rights.


    Thursday, August 30, 2018 8:06 AM
  • Thanks for this, I found this useful. 

    I have folders per user where User A can access user A's folder but not User B's. 

    We call this 'Personal' drives. We also have a public drive which uses the above script and works perfectly.

    Is there a way to map the drive to a specific folder which is different for each user using their username?

    E.g. \\MyServer\UserShares\{Username}

    Thanks in advance!

    Monday, August 5, 2019 6:18 PM
  • Thanks for this, I found this useful. 

    I have folders per user where User A can access user A's folder but not User B's. 

    We call this 'Personal' drives. We also have a public drive which uses the above script and works perfectly.

    Is there a way to map the drive to a specific folder which is different for each user using their username?

    E.g. \\MyServer\UserShares\{Username}

    Thanks in advance!

    I'd start a new thread.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Monday, August 5, 2019 6:44 PM
  • I followed the steps here. Copied the file to the location here: 
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\map.bat

    and also here: C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\map.bat

    Disconnect from the session and logged back in, and still does not seem to run the program on logon. I also modified the Local policy to run the script on Logon but it does not run it.

    If I double-click on it, it works and maps the drive, but it does not do it upon Logon. Am I missing something?

    <style></style>
    Friday, July 24, 2020 3:16 PM