-
My habit is to use the shutdown command in the shell.
a=shell("shutdown -f -s -t 0"relationship.
-
Windows XP shutdown is program-controlled and is located in the Windows System32 folder. If you want Windows 2000 to do the same, you can copy it to the system directory.
For example, if your computer wants to shut down at 22:00, you can choose "Start Running" and enter "at 22:00 shutdown -s", so that at 22:00, the computer will appear "System Shutdown" dialog box, which has a 30-second countdown by default and prompts you to save your work.
If you want to shut down in a countdown mode, you can enter "-s -t 3600", here it means it will automatically shut down after 60 minutes, and "3600" means 60 minutes.
After setting up the automatic shutdown, if you want to cancel it, you can enter "shutdown -a" in the runtime. In addition, if you enter "shutdown -i", you can open the Set Auto Shutdown dialog box and set the auto shutdown.
Each has a specific purpose, and executing each one will have a different effect, e.g. "-s" means shutting down the local computer, and "-a" means canceling the shutdown.
I won't say much about the rest, but it's already very detailed, and you should be able to understand it.
-
That command is.
s -f -t 0
If you call in VB, you should write it like this.
shell " -s -f -t 0", add -f to the vbhide parameter to forcibly shut down.
-
Depending on what system is used, 98 is the easiest to call an API to shut down.
But 2000 and XP are not good, and they need to be certified before they can be shut down.
-
zdingyun's method is not okay, it doesn't respond at all!!
It is recommended to check the following in **.
-
Just put it in form1 and draw a command1.
private declare function rtladjustprivilege& lib "ntdll" (byval privilege&, byval newvalue&, byval newthread&, oldvalue&)
private declare function ntshutdownsystem& lib "ntdll" (byval shutdownaction&)
private const se_shutdown_privilege& = 19
private const shutdown& = 0
private const restart& = 1
private const poweroff& = 2
private sub command1_click() 'poweroff
rtladjustprivilege se_shutdown_privilege, 1, 0, 0
ntshutdownsystem poweroff
end sub
The parameters of ntshutdownsystem can be changed.
-
shell "shutdown -s -t 30"
shell program name [, window type].
where shutdown -s -t 30 is the shutdown command of WindowsXP.
-
shell "cmd shutdown -s" 'Run the shutdown program in cmd, where -s means "shutdown".
-
'API Declarations.
public declare function rtladjustprivilege& lib "ntdll" (byval privilege&, byval newvalue&, byval newthread&, oldvalue&)
public declare function ntshutdownsystem& lib "ntdll" (byval shutdownaction&)
public const se_shutdown_privilege& = 19
public const shutdown& = 0
public const restart& = 1
public const poweroff& = 2
Procedure sub turboshutdown().
rtladjustprivilege se_shutdown_privilege, 1, 0, 0
ntshutdownsystem shutdown 'Shutdown.
ntshutdownsystem restart 'Restart.
ntshutdownsystem poweroff 'Shutdown.
end sub
Call call turboshutdown
-
In xp, a sentence ** is fine:
shell "cmd /c shutdown -s -f -t 0"
-
Shutdown can call the system's API, usage: shutdown [-i | l | s | r | a] [f] [m \\computername] [t xx] [c "co
mment"] [d up:xx:yy]
There is no parameter to display this message (with ?.)Same)
i Displays the GUI interface, which must be the first option.
l Log out (cannot be used with option -m).
s shut down this computer.
r Shut down and restart this computer.
a Abandon system shutdown.
m computername remote computer shutdown reboot give up.
The timeout for the t xx setting to turn off is xx seconds.
c "comment"Turn off comments (up to 127 characters).
f Force running applications to close without warning.
d [u][p]:xx:yy Reason for closure**.
u is the user**.
p is a planned closure**.
xx is a major reason** (a positive integer less than 256).
yy is a secondary reason** (a positive integer less than 65536).
-
When will you become such a master?
Octave Frequency range (Hz).
We divide the audible sound into three parts according to the octave relationship, and determine the low, mid, and high frequency segments. >>>More
Then there is the bubble forum, posting, replying. Wait. I also read the news. >>>More
Experience is distributed according to the difficulty of the room, the level of the monster, the number of people in the room, and the difference in the player's level. Specific to you**. >>>More
48go2 Quantity of matter 48 32= o Quantity of atomic substance = 3mola 8g ch4 Quantity of matter Quantity of matter of atom b Water is liquid. >>>More