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

Reboot and Shutdown Windows XP using VB.NEt

P: n/a
Hi,

I would like to know the code for reboot and shutdown windows xp
professional using VB.Net.

thanx

Senthil
Nov 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try shelling the windows shutdown process.
Example:

'--------------------------------------
' Shelling shutdown process
Shell("shutdown.exe -s")
'--------------------------------------
Usage:
shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c
"comment"]
[-d up:xx:yy]

-i Display GUI interface, must be the first
option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without
warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive
integer less than 256)
yy is the minor reason code (positive
integer less than 65536)

"Senthil" wrote:
Hi,

I would like to know the code for reboot and shutdown windows xp
professional using VB.Net.

thanx

Senthil

Nov 22 '05 #2

P: n/a
Shell the windows shutdown process:

Shell("shutdown.exe -s")

------------------------------------
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx]
[-c "comment"] [-d up:xx:yy]

-i Display GUI interface, must be the first
option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without
warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive
integer less than 256)
yy is the minor reason code (positive
integer less than 65536)
------------------------------------

"Senthil" wrote:
Hi,

I would like to know the code for reboot and shutdown windows xp
professional using VB.Net.

thanx

Senthil

Nov 22 '05 #3

P: n/a
Elp
On Sat, 8 Jan 2005 07:33:02 -0800, Senthil wrote:
I would like to know the code for reboot and shutdown windows xp
professional using VB.Net.


The most reliable way would be to use the ExitWindowsEx API via Interop
with the appropriate parameters. You can find all the needed interop
declarations in this library: http://www.mentalis.org/soft/class.qpx?id=7
Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.