On my Windows machine, I oftentimes want to kill a set of applications that are running. This is especially true when I don’t have full control of my machine and am unable to adjust the applications that launch on startup.
Below are two examples — both accomplish the same feat — that use R to call down to the OS and kill a list of tasks / applications. One example is more readable while the other is more terse. An alternative impetus for writing the short scripts below was to experiment with the processx package. A more portable way to accomplish would be to simply use PowerShell. But this was a fun exercise.