English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

the environment is dos or windows

2006-06-15 20:27:45 · 6 answers · asked by i_am_the_answer 1 in Computers & Internet Programming & Design

6 answers

which language are you working on ?

System.Diagnostics.Process.Start("ShutDown", "/r")

VB.Net

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

No args Display this message (same as -?)
-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 war
ning
-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 le
ss than 256)
yy is the minor reason code (positive integer le
ss than 65536)




What u r basically doing is calling the system command called shutdown....

2006-06-15 20:29:22 · answer #1 · answered by laclockiecelestialle 3 · 0 0

In C


The ExitWindowsEx function either logs off the current user, shuts down the system, or shuts down and restarts the system. It sends the WM_QUERYENDSESSION message to all applications to determine if they can be terminated.

BOOL ExitWindowsEx(
UINT uFlags, // shutdown operation
DWORD dwReserved // reserved
);

Parameters
uFlags
Specifies the type of shutdown. This parameter must include one of the following values: Value Meaning
EWX_LOGOFF Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF Shuts down the system and turns off the power. The system must support the power-off feature.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.

EWX_REBOOT Shuts down the system and then restarts the system.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.

EWX_SHUTDOWN Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.



This parameter can optionally include the following values: Value Meaning
EWX_FORCE Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
EWX_FORCEIFHUNG Windows NT 5.0 and later: Forces processes to terminate if they do not respond to the WM_QUERYENDSESSION or WM_ENDSESSION message. This flag is ignored if EWX_FORCE is used.



dwReserved
Reserved; this parameter is ignored.

2006-06-16 03:34:23 · answer #2 · answered by Taci 2 · 0 0

if you_are_the_answer then y dont you know the answer?
umm hit alt ctrl del and go to shut down and hit restart
or if oyu hit alt ctrl del twice it shuts down too i tihkn ( i know it did in 98 and stuff)

2006-06-16 03:30:03 · answer #3 · answered by Yahoo! Answerer 6 · 0 0

press the control/alt and delete buttons all at the same time.
pressing them once together will take you to the task manager which will allow you to see what processes are running on your computer. if you press all three again, it will restart your computer-REBOOT.

2006-06-16 03:31:20 · answer #4 · answered by great gig in the sky 7 · 0 0

If you use .net vb then you should find it easy to use API function.

2006-06-16 04:25:42 · answer #5 · answered by Joe_Young 6 · 0 0

IT is Dos

2006-06-16 03:30:43 · answer #6 · answered by respectmylaw 2 · 0 0

fedest.com, questions and answers