In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.