Procedure for creating a simple logon script for roaming profile user

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.

Who is Participating?
SkUllbloCkConnect With a Mentor Commented:
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.
bwalker1Connect With a Mentor Commented:
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.
ckangas7Author Commented:
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.

SkUllbloCkConnect With a Mentor Commented:
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
ckangas7Author Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.