views:

395

answers:

2

Hi,

I want to create a script that will run whenever a server is turned on to do basic things like create a directory and copy a binary from an FTP server to it. I need it to run before a user logs in, as soon as the server is turned on. This will be deployed on my EC2 windows servers.

Checking around (http://www.bleepingcomputer.com/tutorials/tutorial44.html) I saw that only services can run before a user logs in.

I saw that I can make my batch into a com (bat2exe) and set it as a service but that doesn't work with internal commands like ECHO, md, etc. I can also fake a service to be "cmd /k batch.cmd".

Both seem cumbersome. Is there an elegant way to do this?

Thanks,

Miki

+2  A: 

You can use the Task Scheduler. Scheduled tasks can run at startup, even before a user logs on (they run in a specified user's context, however).

Joey
+3  A: 

You can use the Windows Task Scheduler and set it for when the system is booted. Here's more info on that Task Scheduler

Jose Basilio