kill (i.e.: stop) all running "Rscript" processes based on their process ID (pid)

kill_all_Rscript_s(s = 0, m = 0, h = 0, ...)

Arguments

s

numeric. number of seconds to wait before killing the processes

m

numeric. number of minutes to wait before killing the processes

h

numeric. number of hours to wait before killing the processes

...

not used.

Value

an integer vector with the process ID (pid) of the "Rscript" processes.

References

tasklist details from microsoft homepage: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb491010(v=technet.10) pskill details from microsoft homepage: https://docs.microsoft.com/en-us/sysinternals/downloads/pskill

See also

Examples

if (FALSE) { # create several running processes of Rscript (to shitdown) system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck # here are there pid numbers: get_Rscript_PID() # let's kill them: kill_all_Rscript_s() # they are gone... get_Rscript_PID() # we no longer have Rscripts running }