Turn off a PC

  • Thread starter Thread starter Cedric News
  • Start date Start date
C

Cedric News

Hi

Please tell me how to turn off a PC who is running with Windows XP
I have already try with "ExitWindowsEX" but I failled.

Please help me, it is very important.
 
Not sure if this will work. But I manage to turn off my girlfirend just by
smiling at her.


;-D
 
One hand is all it takes. Besides which, I may change my name to Two Handed
Man soon as Im able to use my other hand with increasing ease now.

;-D
 
SHTDN_REASON_MAJOR_OTHER = &H0
SHTDN_REASON_MAJOR_NONE = &H0
SHTDN_REASON_MAJOR_HARDWARE = &H10000
SHTDN_REASON_MAJOR_OPERATINGSYSTEM = &H20000
SHTDN_REASON_MAJOR_SOFTWARE = &H30000
SHTDN_REASON_MAJOR_APPLICATION = &H40000
SHTDN_REASON_MAJOR_SYSTEM = &H50000
SHTDN_REASON_MAJOR_POWER = &H60000
End Enum

Public Enum ReasonMinor
SHTDN_REASON_MINOR_OTHER = &H0
SHTDN_REASON_MINOR_NONE = &HFF
SHTDN_REASON_MINOR_MAINTENANCE = &H1
SHTDN_REASON_MINOR_INSTALLATION = &H2
SHTDN_REASON_MINOR_UPGRADE = &H3
SHTDN_REASON_MINOR_RECONFIG = &H4
SHTDN_REASON_MINOR_HUNG = &H5
SHTDN_REASON_MINOR_UNSTABLE = &H6
SHTDN_REASON_MINOR_DISK = &H7
SHTDN_REASON_MINOR_PROCESSOR = &H8
SHTDN_REASON_MINOR_NETWORKCARD = &H9
SHTDN_REASON_MINOR_POWER_SUPPLY = &HA
SHTDN_REASON_MINOR_CORDUNPLUGGED = &HB
SHTDN_REASON_MINOR_ENVIRONMENT = &HC
SHTDN_REASON_MINOR_HARDWARE_DRIVER = &HD
SHTDN_REASON_MINOR_OTHERDRIVER = &HE
SHTDN_REASON_MINOR_BLUESCREEN = &HF
SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE
End Enum

Public Enum ReasonFlag
SHTDN_REASON_FLAG_USER_DEFINED = &H40000000
SHTDN_REASON_FLAG_PLANNED = &H80000000
End Enum

'This function performs the remote shutdown.
<DllImport("AdvAPI32.DLL")> _
Public Shared Function InitiateSystemShutdownEx( _
ByVal lpMachineName As String, _
ByVal lpMessage As String, _
ByVal dwTimeout As Int32, _
ByVal bForceAppsClosed As Boolean, _
ByVal bRebootAfterShutdown As Boolean, _
ByVal dwReason As UInt32) As Boolean
End Function

Private Sub btnShutdown_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnShutdown.Click
'Shut the remote system down.
If (InitiateSystemShutdownEx( _
txtMachine.Text, _
txtMessage.Text, _
Int32.Parse(txtTimeout.Text), _
ckAppClose.Checked, _
ckReboot.Checked, _
Convert.ToUInt32(ReasonMajor.SHTDN_REASON_MAJOR_OTHER Or _
ReasonMinor.SHTDN_REASON_MINOR_MAINTENANCE)) <> True) Then

End If
End Sub
 
SHTDN_REASON_MINOR_BLUESCREEN = &HF

I like that one, surely that should be at the top of the list? My Windows
XP Home system blue screened several times on the first day I had it!! :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Hello William,

Wow! For a minute there I thought nospam was back for another RANT AND
RAVE!!

SHTDN <is> after all, what you do with somene's neck, or so I've heard.

;-).

Regards,
Fergus
 
Hello,

Nak said:
I like that one, surely that should be at the top of the list?
My Windows XP Home system blue screened several
times on the first day I had it!! :-)

I have never seen a bluescreen except the logon form on my Windows XP
Professional machine for the last 1.75 years.
 
Bluescreens in xp can only realistically be cause by the following:

BAD RAM
BAD CPU
BAD HARD_DISK
BAD DRIVERS


maybe this helps, if it is an upgrade from 98 or 31 try reinstalling clean.
 
Not Turning it on helps too

ROFL!!!

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
BAD RAM
BAD CPU
BAD HARD_DISK
BAD DRIVERS

LOL, you missed something
BADLY CODED WINDOWS COMPONENTS

Installing service pack updates and the like helped ;-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Back
Top