Preventing Windows From Shutting Down

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

It is possible from a .NET application to prevent Windows from shutting
down?

I understand that a .NET application can "know" that windows is initiating
the process of to shutting down - but what about *preventing* that shutdown?

(and yes - I know the user can always unplug the machine)

Thanks.
 
Mark said:
It is possible from a .NET application to prevent Windows from shutting
down?

I understand that a .NET application can "know" that windows is initiating
the process of to shutting down - but what about *preventing* that shutdown?

(and yes - I know the user can always unplug the machine)

Thanks.

Also interested.
 
Mark said:
It is possible from a .NET application to prevent Windows from shutting
down?

I understand that a .NET application can "know" that windows is initiating
the process of to shutting down - but what about *preventing* that shutdown?

(and yes - I know the user can always unplug the machine)

Thanks.

You could issue "shutdown -a" from DOS. I assume you were looking for a way
native to C# though...
 
RE:
<<You could issue "shutdown -a" from DOS. I assume you were looking for a
way native to C# though...>>

Would you know offhand if doing that works only if the shutdown was
initiated from DOS (or from the same DOS session).

What I'm getting at is this: IF there is no way native to C#, then my C#
could respond to its detection of the shutdown being initiated, then call a
batch file that does the "shutdown -a". Would that scenario be expected to
reliably abort the shutdown?

Thanks!
 
Jeremy said:
RE:
<<You could issue "shutdown -a" from DOS. I assume you were looking for a
way native to C# though...>>

Would you know offhand if doing that works only if the shutdown was
initiated from DOS (or from the same DOS session).

What I'm getting at is this: IF there is no way native to C#, then my C#
could respond to its detection of the shutdown being initiated, then call a
batch file that does the "shutdown -a". Would that scenario be expected to
reliably abort the shutdown?

Thanks!

Unfortunately, I don't. I am just learning C# now so my knowledge of
anything in C# at this point is very minimal. My best advice would be to
try it.
 
<<You could issue "shutdown -a" from DOS. I assume you were looking for
Not DOS at all. Windows command prompt. 32-bit operating system.
 
Back
Top