已經成功了,那樣就會每10 分鐘看看有沒有firefox run 緊,沒有就開一個,方便家人用firefox,因為通常見到有個brower開著都不會開一個新的,便他們習慣用firefox, 大家都試試
Set WshShell = WScript.CreateObject("WScript.Shell")
dim min ,time
min= 10 'how many minutes you want to check
time = min*60*1000
While true
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'firefox.exe'") 'find there exist firefox running or not
If props.count = 0 Then
FF= WShShell.Run("firefox.exe",3,true)
End If
Wscript.Sleep time
Wend
|