SHARE
TWEET

Untitled

a guest Feb 27th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getWindows() {
  2.   function onlyUnique(value, index, self) {
  3.     return self.indexOf(value) === index;
  4.   }
  5.   let result = shell_exec('tasklist /fi "username eq %username%');
  6.   let proc = [];
  7.   let trim = result.split("\r\n");
  8.   trim.forEach((item, i) => {
  9.     if (i > 3) {
  10.       if (item != "") {
  11.         proc.push(item.split(" ")[0])
  12.       }
  13.     }
  14.   });
  15.   proc = proc.filter(onlyUnique);
  16.   return JSON.stringify(newBuild);
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top