By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,280 Members | 1,232 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,280 IT Pros & Developers. It's quick & easy.

Turn off a PC

P: n/a
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.

Nov 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Not sure if this will work. But I manage to turn off my girlfirend just by
smiling at her.
;-D

"Cedric News" <Ce*********@tiscali.fr> wrote in message
news:ur**************@TK2MSFTNGP09.phx.gbl...
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.

Nov 20 '05 #2

P: n/a
ROFL

How do you turn her on ??? ;-)

Fergus
Nov 20 '05 #3

P: n/a
Cor
>
How do you turn her on ??? ;-)


With one hand?
Nov 20 '05 #4

P: n/a

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
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...

How do you turn her on ??? ;-)


With one hand?

Nov 20 '05 #5

P: n/a
Hello,

"Cedric News" <Ce*********@tiscali.fr> schrieb:
Please tell me how to turn off a PC who is running with
Windows XP I have already try with "ExitWindowsEX"
but I failled.


PInvoke solution:

http://www.mentalis.org/soft/class.qpx?id=7

WMI:

http://msdn.microsoft.com/library/de...tingsystem.asp

http://msdn.microsoft.com/library/de...tingsystem.asp

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6

P: n/a
Hello,

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
schrieb:
Not sure if this will work. But I manage to turn off my girlfirend
just by smiling at her.


;-)))

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

P: n/a
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_OT HER Or _
ReasonMinor.SHTDN_REASON_MINOR_MAINTENANCE)) <> True) Then

End If
End Sub
"Cedric News" <Ce*********@tiscali.fr> wrote in message
news:ur**************@TK2MSFTNGP09.phx.gbl...
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.

Nov 20 '05 #8

P: n/a
Nak
> 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
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #9

P: n/a
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
Nov 20 '05 #10

P: n/a
Hello,

"Nak" <a@a.com> schrieb:
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!! :-)


I have never seen a bluescreen except the logon form on my Windows XP
Professional machine for the last 1.75 years.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #11

P: n/a
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.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:O6**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Nak" <a@a.com> schrieb:
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!! :-)


I have never seen a bluescreen except the logon form on my Windows XP
Professional machine for the last 1.75 years.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #12

P: n/a
Cor
Not Turning it on helps too
Nov 20 '05 #13

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Not Turning it on helps too


But how to access Microsoft Public Newsgroups without a computer?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #14

P: n/a
Cor
Capito
Nov 20 '05 #15

P: n/a
Nak
> Not Turning it on helps too

ROFL!!!

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

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #16

P: n/a
Nak
> 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
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.