Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement