Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getWindows() {
- function onlyUnique(value, index, self) {
- return self.indexOf(value) === index;
- }
- let result = shell_exec('tasklist /fi "username eq %username%');
- let proc = [];
- let trim = result.split("\r\n");
- trim.forEach((item, i) => {
- if (i > 3) {
- if (item != "") {
- proc.push(item.split(" ")[0])
- }
- }
- });
- proc = proc.filter(onlyUnique);
- return JSON.stringify(newBuild);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement