When I execute a long-running R script from the Windows command prompt (cmd.exe), I want my computer to understand that it is "active" and thus remain awake until the script is complete (unless, of course, I manually put the computer into sleep mode).
This is the behaviour observed when I run the script from within RStudio, rather than the command prompt – but RStudio is unsuitable in this case.
Another question points to the SetThreadExecutionState function in C – is there an equivalent in R or cmd that lets the computer know that it is in use?