backup:kill Pop-up ads for webpagetest client

webpagetest use the “pagetest.exe”, so wan can kill all “iexplore.exe” use the following WSH script 🙂

killIE.js

function killIE() {
    var WMIService = GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2');
    var rt = WMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name='iexplore.exe'");
    if (!rt.Count) {
        return;
    }
    var co = new Enumerator(rt);
    for(;!co.atEnd();co.moveNext()) {
        co.item().Terminate();
    }
}

while (true) {
    try{
        killIE();
    }catch(e){}
    WScript.Sleep(1000);
}

加入讨论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据