完成脚本后关闭PC [英] shutdown PC after finishing a script

查看:30
本文介绍了完成脚本后关闭PC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 R 中运行一个需要很多小时的脚本.我希望我的电脑在完成我的脚本后自动关闭.那可能吗?我怎样才能使用 R 做到这一点?我为此搜索了包和函数,但找不到.谢谢附注我的电脑运行的是 Windows 8.1

I'm runnig a script in R that takes many hours. I woud like that my PC automatically shutdown itself after finish my script. Is that possible? How can I do that using R? I've searched for packages and functions for that, but I couldn't find. Thank you P.S. My PC s running Windows 8.1

推荐答案

你可以直接从R调用cmd提示符

You can call the cmd prompt directly from R

system('shutdown -s')

您可以在此处查看其他关机命令:https://stackoverflow.com/a/162305/1362215.如果您想执行其他任务,这可能很有用.

You can view other shutdown commands here: https://stackoverflow.com/a/162305/1362215. This may be useful if you want to perform other tasks.

这篇关于完成脚本后关闭PC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆