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 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
A scheduled task is probably what you want. – and31415 Apr 14 '14 at 22:47

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 '14 at 23:47
@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. – Spamwich Apr 15 '14 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
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 '14 at 23:38

You must log in to answer this question.

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