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 need to put a script in Windows 7, so that it runs before the any user has logged on to the computer. The script needs to keep on running after logging in by any user. So, the script runs as long as the computer is switch on...

share|improve this question
1  
A scheduled task is probably what you want. –  and31415 Apr 14 at 22:47

2 Answers 2

Run gpedit.msc and go to Computer Configuration > Windows Settings > Scripts > Startup and add your script there.

share|improve this answer
    
somehow it does not work! could you please elaborate on that? –  Ali Syed Apr 14 at 23:47
1  
@AliSyed You might have a problem with your script. Remember that if your script makes any reference to the logged-in user then it will fail (since nobody is logged in yet). Make a test batch script containing echo %date% %time% >>c:\test.txt and set that to run on startup. If the file is created then the problem is with your original script. –  user3050461 Apr 15 at 20:24

you can create a batch file to execute your script, and drag the batch file to the system startup folder.

share|improve this answer
2  
This answer lacks some content. If by "startup folder" you mean the folder in the Start Menu, then that batch file will only run after the user logs in. –  Doktoro Reichard Apr 14 at 23:38

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.