久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      VBS腳本調(diào)用系統(tǒng)的關(guān)機(jī)對(duì)話框代碼


      正常情況下,關(guān)機(jī)對(duì)話框是有explorer.exe調(diào)用,直接使用rundll32調(diào)用時(shí)無法觸發(fā)相關(guān)命令。

          既然使用explorer.exe調(diào)用可以,我們可以嘗試使用腳本來實(shí)現(xiàn)。實(shí)現(xiàn)原理:

       

      激活explorer.exe
      按ALT+F4

      編寫VBS腳本如下(將下述內(nèi)容另存為shutdown.vbs):

      Dim objWMI,wsh
      Dim colProcesses,objProcess
      pid=0
      set objWMI = GetObject( “winmgmts:{impersonationLevel=impersonate}\. rootcimv2” )
      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}”

      上述腳本運(yùn)行環(huán)境為:XP SP2
      其他環(huán)境也可能正常工作,不過對(duì)于有多個(gè)explorer.exe進(jìn)程的系統(tǒng),就可能不正常工作了,如開了遠(yuǎn)程終端服務(wù)的多用戶環(huán)境下。

       

      分享到: 更多

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)