os.sleep: Sleeps the operating system (Windows) through a shell command

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/os.manage.R

Description

This sleeps Windows after set amount of time.

Usage

1
os.sleep(s = 0, m = 0, h = 0, first_turn_hibernate_off = 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_off

The command rundll32.exe powrprof.dll,SetSuspendState 0,1,0 for sleep is correct - however, it will hibernate instead of sleep if you don't turn the hibernation off. I'm not sure this is true, but that's what is explained in the linke (see bellow)

Value

The status code of shell.

Author(s)

Tal Galili

References

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

See Also

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

Examples

1
2
3
4
5
6
7
## Not run: 
## when your code is extremely time-consuming,
# you may need this function to run at the end of
# the simulation.
os.sleep()

## End(Not run)

installr documentation built on Oct. 7, 2018, 1:08 a.m.