Re-mapping Corporate shared drive on win 2000-2003 mixed domain.

Posted on 2005-05-03
Last Modified: 2010-04-14
I have just added a file server to our corporate network.  Belive it or not our 60gb shared area is currently located on our web server. so purchasing a dedicated file server was a proiority.  
a root level share called "Share" is mapped on every workstation as the S: drive.  This drive is used in some way by everyone in our organization.

What i need is a the first everytime... method to, at the next user logon delete the old S: drive mapping from \\Webserver\Shared and remap it to \\Fileserver\shared

All the current drive mapping were done manually as the comapny has grown (we put a system in service we map the S: drive as part of the original config)

We made a brief attempt at setting up a logon script in the Group Policies but it was a disaster.  all it really ever consistantly managed to do was delete the S: drive mapping.

I really need this to go seamlessly.  Any help would be appreciated.

Thanks in advance

500 points cause this is important and i need it fast !
Question by:mnichols1202
    LVL 18

    Assisted Solution

    You should be able to use this as a login script:


    'Remove drive if mapped already
    If FileSysObj.DriveExists("s:")=True then
        objNetwork.RemoveNetworkDrive "s:"
    End if

    'Map drive for all users
    objNetwork.MapNetworkDrive "s:", "\\fileserver\share"

    Author Comment

    Awsome,  But i have a few questions.

    this is a vbs file?  do i put it in a bat file?
    how do i ensure it runs for everybody?  if i put it in the top level Group policy will it "trickle down" to the lower level policies.

    is there a way to test this before deployment?

    LVL 8

    Expert Comment

    You can use a logon script, just copy it to the sysvol folder and in active directory users and computers, edit the user so that it runs the script.

    The script can be in a batch file

    1. To remove the drive


    2. To map the drive
    This syntax will recreate a mapped networkdrive at each startup :
    net use s: \\Fileserver\shared /persistent:NO

    If there is a username and password for the drive then
    net use s: \\Fileserver\shared password /user:domain\username /persistent:NO
    LVL 8

    Expert Comment

    Regarding luv2smile suggestion and your question
    Once the file has been created, create a batch file by
    Opening notepad
    cscript logon.vbs
    then simply save it as logon.bat
    You can then use it as any other batch file

    And yes, place this on the highest OU and it will filter down for all users

    As a test, create a test OU, add another OU inside that, then place a user in each OU and watch it work :)


    Author Comment

    anil_u and All,

    Thats exactly what we tried in our earier attempt several months ago,  I managed to delete the drive well enough but it only managed to re-map the drive on the rare occasion.  Any thoughts on how to test this thing so it appears nothing has changed for the end user?  I really need to be sure of this cause it's my @$! if this thing doesn;t work!  : )  Plus if i manage, like last time, to delete everyones maps i have well over 200 workstations to manually remap...again!

    Also Deleteing and remapping at each logon - seems dicy  - a persistent map would be better - and a way to check the current mapping...if it's ok then don't do the remap.

    LVL 8

    Accepted Solution

    Yes I agree, You may want to run two scripts, one to remove the drive (this can be run once) and one to check if it exists and if not then add it

    Here a batch file that will check if it exists and if not then map it


    net use s: \\Fileserver\shared /persistent:NO


    More info

    There are ways to exclude policies from propagating through the OU, but this is just a logon script that would be run everytime a user logs on, so not sure why this would not run
    LVL 8

    Expert Comment


    Glad I could help


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    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…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 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

    8 Experts available now in Live!

    Get 1:1 Help Now