Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Within PowerShell 2.0 running in Windows XP, I execute the following command:

Restart-Computer

And get the following message:

Windows cannot end this program. It may need more time to complete an operation.

To return to Windows and check the status of the program, click Cancel.

If you choose to end the program immediately, you will lose any unsaved data. To end the program now, click End Now.

This happens whether I restart from PowerShell or from Windows itself. Any idea how I can restart a computer that will close a PowerShell console without prompt?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

Use -Force to cause an immediate restart of the computer

share|improve this answer

One way is to use shutdown.exe with the -f parameter. Run shutdown /? from a cmd window for the full details.

share|improve this answer

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.