os.hibernate: Hibernate the operating system (Windows) through a shell...

View source: R/os.manage.R

os.hibernateR Documentation

Hibernate the operating system (Windows) through a shell command

Description

This Hibernates Windows after set amount of time.

Usage

os.hibernate(s = 0, m = 0, h = 0, first_turn_hibernate_on = TRUE)

Arguments

s

time to wait before shutting down (in seconds), added to m and h; passed to Sys.sleep

m

time to wait before shutting down (in minutes), added to s and h; passed to Sys.sleep

h

time to wait before shutting down (in hours), added to s and m; passed to Sys.sleep

first_turn_hibernate_on

default is TRUE. This runs "powercfg -hibernate on" in order to turn hibernate on, in cases where it was off.

Value

The status code of shell.

Author(s)

Tal Galili

References

https://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu , https://www.howtogeek.com/howto/windows-vista/quick-tip-create-shutdown-restart-lock-icons-in-windows-vista/

See Also

system,shell, Sys.sleep, is.windows, os.shutdown, os.sleep, os.hibernate, os.lock, os.restart

Examples

## Not run: 
## when your code is extremely time-consuming, 
# you may need this function to run at the 
# end of the simulation.
os.hibernate()

## End(Not run)

installr documentation built on Nov. 13, 2022, 1:06 a.m.