Category Archives: Tutorials

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.


Workshop: Windows Phone 7 Game Development Lesson 3 coming up next week

We will display some 2D stuff and move it around.

Display Line Number in Visual Studio 2010 Express

The standard setting in Visual Studio 2010 Express is to display no line numbers. To activate them follow the steps below.

Go to Tools -> Options on the toolbar.

Check the box ‘show all settings’

Go to ‘All languages’

Check the box in front of ‘Line numbers’ in the Display section.

Display Line Numbers

Quick and dirty backup script [windows]

If your usual backup software takes ages to make a decent backup of your computer and you need a quick (and dirty) way to backup you project directory you could use robocopy.

The syntax is easy enough:

robocopy  SOURCE  DESTINATION  /parameters

For example, you need to backup your local development webserver:

robocopy “c:\xampp\htdocs” “e:\dev-server\” /E /COPYALL

This would copy everything newer or changed from your local htdocs directory to the ‘dev-server’ directory on drive e:

The parameters:

/E – includes subdirectories

/COPYALL – includes file information

For a detailed list type in robocopy /?

I made myself a backup.bat on c:\ and put all robocopy commands i need executed in it. So i can type ‘backup’ on the command line and every backup i need is made.

Backup your XNA game projects on a USB drive.

[YOUR USERNAME] = Windows account you use to develop (executing user must have reading rights on files, can be done as admin)

X: = Letter your USB drive gets assigned in explorer. You can change it there, but there’s usually no need for that.

robocopy “c:\Users\[YOUR USERNAME]\Documents\Visual Studio 2010\Projects” X:\MyProjects\VS2010 /E /COPYALL

robocopy “c:\Users\[YOUR USERNAME]\Documents\Visual Studio 2008\Projects” X:\MyProjects\VS2008 /E /COPYALL

Put these two lines in a filename.bat to backup XNA3.1 and XNA4.0 at the same time.

Workshop: Windows Phone 7 Game Development Lesson 1 online

New workshop: Windows Phone 7 Game Development for Beginners

This weekend i will start a new tutorial series that deals with game development for windows phone 7.

I will start at the very beginning and we will take you through the process of developing a simple game for the windows phone 7 device emulator. So that’s right, you do not need a WP7 phone to particiate. Everything we will use will be free.

All you need is your

  1. computer
  2. internet connection
  3. some time

Stay tuned.

Spoiler: Lesson 1 – What do i need, where do i get it and how do i install it?

%d bloggers like this: