关机前给所有用户发消息

tam*_*ani 4 windows

当我在 Windows 2008 服务器上时,如何通过 CMD 向其他用户发送消息?

我通常这样做shutdown -r -t 30,但是如何向此命令添加文本?

Hos*_*its 18

shutdown -r -t 30 -c "This system is shutting down in 30 seconds.."  
Run Code Online (Sandbox Code Playgroud)

-c "text"将其添加到显示窗口通知关机的其他用户的评论。

对于 Unix,语法为shutdown -r -t 30 "This system is shutting down in 30 seconds..

  • Unix 各不相同。在 OS X(和 Linux)上,您需要 `shutdown -r +5 "message"`,在 5 分钟内关闭。(不是 -t,它指定让程序正常退出的时间量。)您可以改变时间,但 1 分钟是最小值。更长的时间可能会更好,因为它实际上让用户有机会做出反应,或者甚至联系管理员以中止关闭。在 Solaris 上,您可以:`shutdown -y -g 30 -i 6 "message"` 关闭 30 秒。 (2认同)