I need a KIX Start Up Script to remove a mapped drive.

Posted on 2009-04-21
Last Modified: 2012-05-06
Hello there,

Please could someone help with a KIX SCRIPT Login script.

We need to remove the S: drive mapping from user's profiles on our Windows network.

We currently run a KIX Login script so we need to add this solution to the bottom of this one.

Ideally it needs to check to see if the S: drive is already mapped and then reomve it if it is.

Many thanks,

Question by:jonojones78
    LVL 14

    Assisted Solution

    Example to delete a mapped drive (T: in this case):

    use t: /delete /persistent

    Author Comment

    Any idea how you can test to see if t: exists first?

    The whole script ready to use would be good.

    Many thanks for your reply,

    LVL 14

    Accepted Solution

    Here's a sample of ours.  We check for domain group membership and then map the drive if the user is a member of the group.  We don't bother determining if the mapping already exists.  So below I'm determining if the user is a member of Domain Users.  If they are (which should be all of our users), then we first delete any currently mapped T: (to ensure it is available) and then map T: to the correct share.

    If InGroup ("Domain Users")
          ? "Mapping T:..."
          use t: /delete /persistent
          use t: "$FileServer\transcripts"
          If @ERROR


    Author Closing Comment

    Many thanks guys. The Goodgrade was for not having the code to determine if drive is already mapped, but that's fine.

    Author Comment

    Cheers guys.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
    Learn about cloud computing and its benefits for small business owners.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

    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

    18 Experts available now in Live!

    Get 1:1 Help Now