Execute batch script on windows 7 logout or login

Sorry, used a german windows version for the screenshots. I am currently on holiday and had to use this version. Will change them next week.

A useful addition to the robocopy backupscript is an automatic execution at specific events. Like on login or logout or system startup.

To configure this you need to edit the group policies. Press start and enter gpedit.msc.


Start gpedit.msc

Next you navigate to the user configuration -> windows settings -> scripts section in the application.

Double click on the event you would like to trigger your script. Like logout for example.



Select your script, in my case backup.bat. Copy the file to the destination shown when you press the button ‘files’.

You might want to activate under admin-templates -> system -> scripts  the output for your script, so you know what your computer is doing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: