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.

  • 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... – user62491 Nov 22 '11 at 9:19

Sounds like you want Logon scripts

  • 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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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