473,406 Members | 2,293 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,406 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 5008
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.