Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

4 Answers 4

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
1  
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 ago....it uses a Windows Server 2003 utility called srvany.exe. Here is some information on somebody using the process on Windows Server 2008: social.technet.microsoft.com/Forums/en-US/winserverMigration/… –  mdpc Feb 19 '13 at 6:17
add comment

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
1  
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
add comment

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):

http://teusje.wordpress.com/2012/09/11/windows-server-logging-users-logon-and-logoff-via-powershell/

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
1  
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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.