Windows Server 2003 Login Script

Posted on 2006-05-11
Last Modified: 2011-09-20

Can someone please give me an example of a .bat script that will create a mapped drive based on someone's username?  For example, if my name is John Doe, and my username is jdoe, and I have a user folder called jdoe in the Users folder on the data drive of the server, what would be the command to put into a .bat in order to map the drive everytime I log in?  I have approximately 65 users, and would like to automate this for each user, without them having a broad mapped drive to the Users folder.

Question by:Srobo
    LVL 1

    Accepted Solution

    In a batch file, you could use the line:

    net use X: \\servername\share\%USERNAME%

    X is whatever drive letter you want to map.
    LVL 82

    Expert Comment

    Simply define the share in the user's profile in ADUC as home drive with the according letter. The drive will then be mapped automatically.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
    I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now