Javascript to get running processes?

后端 未结 4 657
旧时难觅i
旧时难觅i 2020-12-19 06:36

I\'m wondering if it\'s possible to use Javascript in a web browser (most likely IE) to retrieve a list of currently running processes?

I\'m not trying to start any

4条回答
  •  無奈伤痛
    2020-12-19 07:00

    Yes, you can! The following approach targets only MSIE and may raise security warnings.

    When executed under MSIE, the following code lists all Windows processes in the browser window and shows a javascript alert if McAfee is running:

    
      
        

    Credit: inspired by https://stackoverflow.com/a/6834585/698168

    This code was tested under the following browsers:

    • MSIE 8.0.6001.18702 / Windows XP Pro
    • MSIE 10.0.9200.16521 / Windows 7 ; Standard document mode
    • MSIE 11.0.9600.16428 / Windows 7 ; Edge (aka MSIE11) document mode

    If you got a JavaScript error Automation server can't create object when creating the ActiveXObject, you may need to set MSIE's Security option Initialize and script ActiveX controls not marked as safe for scripting to either Prompt or Enable.

    Under Firefox, you should use something based on XPCOM's nsIProcess. Note that tasklist.exe is not available under all Windows version: AFAIK it's available since Windows XP Pro.

提交回复
热议问题