user836112
user836112

Reputation: 383

How to run a batch file when window starts up? (log in issue)

Currently, I want a remote machine (Amazon EC2 instance) to run a batch file when the machine starts up, and the batch file will close the machine after finishing the tasks.

I tried to put the shortcut of batch file to the startup folder. However, it will be only ran when I use Remote Control Connection to Log in that machine.

So, any other way to solve this problem??? NOTE: I don't want to log in to that machine since there might be 10 remote machines running at the same time.

Any idea or thought is appreciated. Thanks a lot.

Upvotes: 1

Views: 5069

Answers (2)

Anthony Miller
Anthony Miller

Reputation: 15930

Windows XP (I believe Vista and 7 its the same as well, not sure about NT/2000)

Run gpedit.msc

Local Computer Policy -> Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown)

Open Startup. Click Add... Script Name: is where you input or Browse the location of your batch script to run. Script Parameters you can leave blank if you have no additional parameters you wish to pass w/it.

Upvotes: 1

wimh
wimh

Reputation: 15232

This looks a bit like the question Running Batch File in background when windows boots up, my answer there:

You can use autoexnt for this. It was original designed for windows NT, but is still working in newer versions of windows.

You have to download the Windows 2003 Resource Kit to get it.

Upvotes: 2

Related Questions