473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Turn off a PC

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
16 2511
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
ROFL

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

Fergus
Nov 20 '05 #3
Cor
>
How do you turn her on ??? ;-)


With one hand?
Nov 20 '05 #4

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
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
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
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
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
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
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
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
Cor
Not Turning it on helps too
Nov 20 '05 #13
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
Cor
Capito
Nov 20 '05 #15
Nak
> Not Turning it on helps too

ROFL!!!

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

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #16
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Rilling | last post by:
When creating an MSI through VS.NET, does the setup project allow me the ability to turn anonymous off. Basically, my web app uses Windows Authentication, but the MSI turns both that and anonymous...
2
by: scorp7355 | last post by:
I was wondering if there is some other way to turn autocomplete off besides using "autocomplete=off", using a meta tag or something similar. It would be great if there is some way to turn it off...
2
by: deko | last post by:
I want to turn error handling off, then back on in a sub routine that backs up a select set of documents. For some reason, I can't seem to get this to work - Private Sub BackupDocs() On Error...
3
by: ilushn | last post by:
Help! I am having a very aggervating problem with Access. Call me lazy, but I like to copy and paste addresses from Access into microsoft work, like for sending letters where I only need about 3...
2
by: Scott | last post by:
I having a problem where I need to turn off the wrapping feature for all columns in my datagrid. Example code would be: <asp:DataGrid id="ResultGrid" runat="server" AutoGenerateColumns="true">...
3
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we...
10
by: Zabby | last post by:
hi, i want to turn on/turn off a usb lamp via a vb.net button... i think i would have to turn on/turn off the power for this usb port.... how could i do this? kind regards
1
by: Lonewolf | last post by:
Hi, could someone please enlighten me on how I could turn on the above mentioned two windows services programmatically? Reason is i am writing a program which needs to turn on these two services...
2
by: cruddpuppet | last post by:
My school computer has monitor issues (turns off every 2 minutes) and I have to constantly turn it back on. I don't have the software or the privelages to install the software needed to scan for...
13
by: Cross | last post by:
I am developing an application that will show movies. When you wach a movie, you do not want the Power Option "Turn off monitor" to be anabled. Is there anyway to fix this from VB.net? (note that I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.