Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written a batch script which copies of some files in the CommonAppData folder (C:\ProgramData) to the logged in User's Local AppData. What I would like to do is to execute this script for every user every time they login. I found many articles talking about the execution of batch files on startup but I would like to know how to do the same on each login.

I've a written a batch file and copied it in :


But it does not seem to be working.

share|improve this question
please let me know why should there be a downvote? – user841923 Nov 22 '11 at 8:01
Probably because it wasn't really clear what you were asking. And because it was a pretty "basic" question, although it's perfectly legitimate one in my opinion. @ptman has your answer... – kce Nov 22 '11 at 9:19
up vote 4 down vote accepted

Sounds like you want Logon scripts

share|improve this answer
how do you write one? what language is it? – user841923 Nov 22 '11 at 6:16
I have written a sample vbs script to copy a file from D:\ to C:\, where should I save the file so that it executes in login? – user841923 Nov 22 '11 at 6:34

In case it is needed at home or something small you could put it in the Startup folder of the user, it get executed each time the user enters the system.

It is simple, but I like to keep things like that.

share|improve this answer
where is that folder located in the computer? – user841923 Nov 22 '11 at 6:58
Windows 7 and Vista c:\Users[username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup Windows XP c:\Documents and Settings[username]\Start Menu\Programs\Startup – Hanan N. Nov 22 '11 at 7:05
but then it would be executed only when the system boots. My requirement is to execute on user login – user841923 Nov 22 '11 at 8:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.