473,326 Members | 2,148 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,326 software developers and data experts.

Restart Computer (Windows XP) from VB.Net Program

What is the best way to close my program gracefully and have the computer
restart on a Windows XP system?
Nov 21 '05 #1
5 5006
Sarah,

I think the best way is to go to start and than choose the restart icon in
your language.

When you want to do it without that start menu you can maybe try this one.

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

I never tried it.

However hopes it helps you,

:-)

Cor
Nov 21 '05 #2
"Sarah" <sa********@powertechcanada.com> schrieb:
What is the best way to close my program gracefully and have the computer
restart on a Windows XP system?


P/invoke:

WindowsController
<URL:http://www.mentalis.org/soft/class.qpx?id=7>

WMI:

<URL:http://groups.google.de/groups?q=WMI+reboot+dotnet>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
> > What is the best way to close my program gracefully and have the
computer
restart on a Windows XP system?


P/invoke:

WindowsController
<URL:http://www.mentalis.org/soft/class.qpx?id=7>


Can you walk me through the steps to add the WindowsController class for
VB.NET to my VB.Net app? When I add the "TestApp.vb" and
"WindowsController.vb" files to my existing project, I get errors in
TestApp.vb that "Imports Org.Mentalis.Utilities" cannot be found.
Nov 21 '05 #4
"Sarah" <sa********@powertechcanada.com> schrieb:
WindowsController
<URL:http://www.mentalis.org/soft/class.qpx?id=7>


Can you walk me through the steps to add the WindowsController class for
VB.NET to my VB.Net app? When I add the "TestApp.vb" and
"WindowsController.vb" files to my existing project, I get errors in
TestApp.vb that "Imports Org.Mentalis.Utilities" cannot be found.


Remove the 'Namespace...' and 'End Namespace' in "WindowsController.vb", and
the line 'Imports Org.Mentalis.Utilities' in "TestApp.vb".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
You can download my user sample from the following page:

http://www.gotdotnet.com/Community/U...c-4a9a89d47fad

Please remember who wrote it though.

"Herfried K. Wagner [MVP]" wrote:
"Sarah" <sa********@powertechcanada.com> schrieb:
WindowsController
<URL:http://www.mentalis.org/soft/class.qpx?id=7>


Can you walk me through the steps to add the WindowsController class for
VB.NET to my VB.Net app? When I add the "TestApp.vb" and
"WindowsController.vb" files to my existing project, I get errors in
TestApp.vb that "Imports Org.Mentalis.Utilities" cannot be found.


Remove the 'Namespace...' and 'End Namespace' in "WindowsController.vb", and
the line 'Imports Org.Mentalis.Utilities' in "TestApp.vb".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Spiegel | last post by:
Hi all, Is there a way to programmatically restart Windows (2000, specifically), login automatically then start an application? I've been running across some Windows Shell options (which...
3
by: | last post by:
I want use C# to restart my computer, how to?
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
10
by: amirmira | last post by:
I have a Windows Service developed in VB.NET that attempts to connect to a database as soon as the service starts. I have no problem when I start the service manually - but when I restart the...
5
by: Phil Tusa | last post by:
Greetings to all .... I have a need to issue a shutdown and/or Restart Windows XP inside my application. Any help or example code would be appreciated! -- Phil
2
by: subsanta | last post by:
My computer has so many problems and ive looked around on the internet and ive managed to fix some of them. I know that i have a few viruses on my computer, but i cant get rid of them, in one case i...
1
by: =?Utf-8?B?Tk9HT0dMTw==?= | last post by:
When I try to restart my computer it freezes at "Windows is shutting down" screen and I have to manually shut it down. Could someone help me solve this problem. My computer is a HP note book...
2
by: Astan Chee | last post by:
Hi, I have a python module that keeps on crashing with various windows errors (not BSOD but the less lethal windows XP popup ones). Now these are intentional and rather sporadic so I cant really...
3
by: bizcoach | last post by:
I acted too quickly today and now I need help in restarting my computer. I hope this is the right section for posting this. I have a Dell Inspirion laptop with Windows XP. My computer wanted...
0
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.