In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to use script to call the shutdown dialog box of the system", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn the article "how to use script to call the shutdown dialog box of the system".
Specific method: start / run:
The copy code is as follows:
Rundll32.exe shell32.dll # 60
However, there will be a problem with the above method, which can not be used to shut down the computer normally under XP (thanks to netizens Mu Ye for finding this problem). The reason for the problem may be that under normal circumstances, the shutdown dialog box is called by explorer.exe, and the relevant command cannot be triggered when it is called directly with rundll32.
Now that we can use the explorer.exe call, we can try to do it using a script. The principle of implementation:
Activate explorer.exe
Press ALT+F4
Write the VBS script as follows (save the following as shutdown.vbs):
The copy code is as follows:
Dim objWMI,wsh
Dim colProcesses,objProcess
Pid=0
Set objWMI = GetObject ("winmgmts: {impersonationLevel=impersonate} /. / root/cimv2")
Set colProcesses = objWMI.ExecQuery ("SELECT * FROM Win32_Process" & _
"WHERE Name='explorer.exe'")
For Each objProcess In colProcesses
Pid = objProcess.ProcessId
Next
Set wsh = WScript.CreateObject ("WScript.Shell")
Wsh.AppActivate pid
Wsh.sendKeys "{F4}"
The above script running environment is: XP SP2
Other environments may also work, but systems with multiple explorer.exe processes may not work properly, such as in a multi-user environment with remote terminal services.
The above is all the contents of the article "how to use script to call the shutdown dialog box of the system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.