Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up my computer to boot at the same time everyday when I am not home. I need it to run a batch file without anyone touching it right when it boots.

I have added a shortcut to the file in the "startup" folder. However, the script doesn't run until I log on and select the desktop from the metro interface.

Is there a way to have this script run without logging in?

share|improve this question
up vote 0 down vote accepted

You could use some of the windows utilities and turn a script into a service. I have done that before and there was information about doing this that was easily found.

More info: Best srvany.exe for Windows XP and Windows 7?

share|improve this answer
I used a tool called AlwaysUp as I could not find a means of turning a batch script into a service without use of a tool. – Kreuzade Feb 19 '13 at 3:59
Found the reference about something that I had used to do this several years uses a Windows Server 2003 utility called srvany.exe. Here is some information on somebody using the process on Windows Server 2008:… – mdpc Feb 19 '13 at 6:17

If you have Windows 8 Pro, open the search charm for apps using Windows logo key‌+Q, type gpedit.msc and open the Local Group Policy Editor.

  • Under Computer Configuration / Windows Settings you'll find Scripts (Startup/Shutdown)

  • Under User Configuration / Windows Settings you'll find Scripts (Logon/Logoff)

Specify your batch file or PowerShell script here.

share|improve this answer
This seemed to work once I typed in my password, not before. Any way to make it happen before? – Kreuzade Feb 8 '13 at 0:39
Logon scripts under User Configuration run with user-level credentials, so AFAIK the user has to log in first. You could try a startup script instead, or perhaps have the logon script execute after the password is entered (as above), but delay the desktop from being loaded until the script has completed executing. For this, Enable Computer Configuration / Administrative Templates / System / Scripts / Run logon scripts synchronously. – Karan Feb 8 '13 at 0:53

Follw the steps on this URL. It shows you how you can also start a PowerShell script (which is more preferred instead of a batch script):

share|improve this answer
So how is this any different from what I posted? The exact same dialog allows you to specify batch files or PowerShell scripts. Also, link-only answers are not preferred here. To protect from link rot, always add as much as you can of the information here (but try not to plagiarise huge blocks of information word for word). – Karan Feb 8 '13 at 18:33
ok, sorry my bad. it included screenshots, which make it sometimes easier + shows you also the powershell. – juFo Feb 10 '13 at 12:16
If you think an existing answer can be improved with screenshots, just add them! Or at the very least you should add them to your answer. – Karan Feb 10 '13 at 17:08

Did windows 8 do away with the Autoexec.nt file? When I have been lazy I have made a exe with rar with nothing but a batch file and needed programs. Then I set up that custom exe as a service. I have no idea if that can be done in 8. I know I shouldn't answer a question when I don't know the operating system, forgive me if I annoy.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .