Linux.com

Home Learn Linux Linux Answers Hardware Is it possible to setup a samba share to always mount to a specific Windows drive letter???
Answers
  • Hi,

    Network shares can't automatically be set to a drive letter assigned by the administrator if it is mounted manually by the user.

    The best way to go is a login script which forces the share to be mounted with the drive letter.

    The simplest way is to:
    Open up Notepad in Windows and paste in the following:

    @Echo Off
    net use H: \\192.168.1.10\myshare


    Replace the \\192.168.1.10\myshare with the path to your Samba share.

    Save the file as "samba.bat" in "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" for it to apply to all users on that computer. Be sure to use quotation marks in the file name, or your file will end up as "samba.bat.txt".

    If it requires authentication you can add a switch:

    @Echo Off
    net use H: \\192.168.1.10\myshare /USER:myusername mypassword


    Replace myusername and mypassword with your Samba username and password.

    Note that this stores the password in clear text.

    If the users should have separate login scripts you can place the file in the users own Autostart folder. "C:\Documents and Settings\\Start Menu\Programs\Startup"

    Source: [url]http://noobbox.com/2009/04/auto-mount-samba-share-ubuntu-and-windows[/url]

    There is also a guide here, [url]http://oreilly.com/catalog/samba/chapter/book/ch06_06.html[/url], which gives a little more advanced options.

    I hope this will help you on your way.

    Best regards
    Mattias

    Answered by Egly
    5 years ago
    1 2
  • In Windows, right click 'My Computer', select 'Map Network Drive', choose the drive letter you want (in your case H:), set the location to the Samba share and check the box that says reconnect on login.

    Answered by Seekret
    5 years ago
    1 2
  • [quote name="Frank"]In Windows, right click 'My Computer', select 'Map Network Drive', choose the drive letter you want (in your case H:), set the location to the Samba share and check the box that says reconnect on login.[/quote]

    Yeah, I forgot about that. KISS, if it is a small environment this is the easiest way.

    BR
    Mattias

    Answered by Egly
    5 years ago
    1 0
  • It sounds like an enterprise environment, so I would suggest going the logon script route. Mapping drives manually on more than a couple machines can be very tedious.

    Answered by jmichelsen
    5 years ago
    1 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Hardware

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    03 Nov » 07 Nov - Virtual
    Details
  2. LFS416 Linux Security
    03 Nov » 06 Nov - Virtual
    Details
  3. LFS426 Linux Performance Tuning
    10 Nov » 13 Nov - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board