Server Fault is a question and answer site for system and network administrators. 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'm trying to install some software using a batch script and using schtasks to start a service every day at midnight.

The script works fine, but it prompts for a password, which causes the script to hang. I've tried using the '/RU "user" /RP ""' flags, which seemed to work in XP, but not under Vista.

What is the right way to do this?

share|improve this question

If you understand the security implications*, you could run tasks with the local System account without a password.

SCHTASKS /Create /TN MyTask /TR "C:\MyTask.bat" /SC ONSTART /RU SYSTEM

This also works through the GUI, just enter SYSTEM as the user name and leave the password field blank.

*The biggest security risk would be someone changing the script or executable your scheduled task is pointed at. Be sure to set the file permissions accordingly.

share|improve this answer
You can further read about it here: – Moshe Aug 4 '09 at 16:31

Have you tried /u and /p (without the R)?

From the help file:

/U username Specifies the user context under which the command should execute. /P password Specifies the password for the given user context.

Alternatively you could try using this utility to create a run as command for your task:

share|improve this answer

Your Answer


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.