Windows – Run a batch file before user logs into Windows 2003 R2

batch filebootwindows-server-2003windows-server-2008-r2

I have an Amazon EC2 machine (Windows Server 2003 R2) where I want to run a script (.bat file) when the Windows Server 2003 R2 machine boots up. This need to run BEFORE any user logs in. Ideally I'd like to extend the same work-around on my Windows Server 2008 R2 instances too – but Windows Server 2003 R2 is critical for me as of now.

Purely as FYI, the .bat file updates the DDNS records so the EC2 machine doesn't need to consume static IPs.

Best Answer

Use GPedit.msc

Go under Computer Management/Windows/Scripts/Startup.

Place your script there.

Note that the script will run under the LOCAL SYSTEM account.

You can use the same method on your 2008R2 instances also.

Related Question