Procedure for creating a simple logon script for roaming profile user

Posted on 2006-05-04
Last Modified: 2010-04-18
Hi all,

I've never had to use logon scripts before so I need some help.  I need to create a very simple .bat logon script for a user with a roaming profile.  The script will basically copy some files from the server to the computer the user is working on.  Where would I store the script?  Can I use just a regular .bat file?  Can anyone give me a brief on the procedure for setting this up?  Thanks.

Question by:ckangas7
    LVL 2

    Accepted Solution

    Logon scripts are usually stored in the C:\WINDOWS\SYSVOL\domain\scripts\ folder
    I am guessing that the environment must be a domain... open active directory and go to the properties of the user who requires this logon script, click on the profile tab and add the .bat filename under logon script:

    what type of files need to be copied? usually a correctly configured roaming profile wont need file to be copied manually, it should be done by the OS, unless they require specific files.
    LVL 11

    Assisted Solution

    Make sure that you give the "read" and "apply group policy" to the users that need the script as well.  That way you do not have to give the script to every user in AD, just the ones that need it.

    Also, you might want to think about using offline files instead of a script - that essentially does the same thing, but is more sophistacated than using a .bat file to copy files from a server to client and back.

    Author Comment

    Hey guys,

    Thanks for your input.  To answer your questions there is only one file that needs to be copied.  For some reson a paticular user keeps losing her file for MS Word, evertime she logs off and logs back on the Domain.  It seems that the file dissapears on logoff and is created new on login.  It doesn't matter if I put the correct file in her profile on the server or on her workstation.  I think It might be an issue with some other software we use that adds some macros to the file.  I have a request with the software vendor to investigate the issue.  The problem is tied to her profile as it travels to whatever computer she logs onto.  I have nuked and rebuilt her profile twice now.  It fixes the problem for awhile, but then it comes back.

    My idea for a temporary workaround is to create a logon script that will copy the correct file from the server to her machine everytime she logs on.  

    When the logon script runs will it run from the server or will it run as if it where on the user's workstation?  If it will run only on the Server, how can I direct the server to copy the file to the correct computer if the user is logging on at different workstations?  Thanks for your help.  Point will be awarded.

    LVL 2

    Assisted Solution

    Hi Charlie

    The script is luanched on the client side.. in other words it runs from the users side.
    If you really want to use a batch file, he is an example of code that you could use:

    xcopy <source> <destination> /v /q /y /z

    <source> is the location of the file on ther server (refference it through a shared location.. ie: \\\shareDirectory1\Filename)
    <destination> is the location you want the file to go. (refference it to the exactly DIRECTORY.. ie: c:\directory1)
    /v means it will verify the file copied
    /q does this in a "quiet mode" (no xcopy messages displayed)
    /y suppresses any prompts
    /z means the file will copy in restartable mode

    Author Comment

    You guys are great.  After the last profile nuke the problem has not come back, but if it does I will be ready.  I also have a better idea of how to write logon scripts for other issues that might arise.  Thanks.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
    On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 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

    19 Experts available now in Live!

    Get 1:1 Help Now