To run when no user has logged in, it has to either be a service or run using the Windows Startup script feature.
And this is no trivial thing if you want it to keep running after a user has logged out....I spent quite some time trying to get a program to run in a similar situation, (see here
However, if it's not necessary that the program run after a user logoff then it should be possible write a AutoIt program that'll do the job.
EDIT: Otherwise, take a look at DShutdown
which can do what you want and you can also run it as a Windows Startup script using it's command line options, (which should take care of the pre-user logon requirement).