ApprenticeHacker
ApprenticeHacker

Reputation: 22011

Don't display the alert box when shutting down Windows?

When I call something like:

Process.Start("shutdown", "/s /t 60");

An alert message box appears with a message like "Your computer will shutdown in less than 1 minute". How to I prevent that from appearing? Is there another way to shut-down windows?

Upvotes: 0

Views: 836

Answers (2)

Dante
Dante

Reputation: 3316

You can write:

Process.Start("shutdown", "/p");

Upvotes: 2

ygssoni
ygssoni

Reputation: 7349

try:

  Process.Start("shutdown", "-f -t 0");

Upvotes: 1

Related Questions