Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1009616 // windows_killAll - see unix_killAll

JavaX fragment (include)

static L<Int> windows_killAll(fS pattern, O... _) {
  ret windows_killAll(cicAsFunction(pattern), _);
}

static L<Int> windows_killAll(F1<S, Bool> f, O... _) {
  if (!isWindows()) fail("No Windows");
  new L<Int> pids;
  for (OSProcess p : oshi_listProcesses()) {
    S command = p.getCommandLine();
    if (f.get(command)) {
      int pid = p.getProcessID();
      pids.add(pid);
      print("Killing " + pid + ": " + command);
    }
  }
  windows_killProcesses(pids);
  ret pids;
}

Author comment

Began life as a copy of #1009587

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009616
Snippet name: windows_killAll - see unix_killAll
Eternal ID of this version: #1009616/11
Text MD5: 5311b385b724fc31ba6d6aeac5d7f307
Author: stefan
Category: javax / windows
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-15 17:31:17
Source code size: 500 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 509 / 526
Version history: 10 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1009630 - windows_killAll - non-working version with wmic