how can i write a program which starts before logging on to windows?!
You need to write a Windows Service.