如何在Windows中从cygwin执行关机命令

如何在Windows中从cygwin执行关机命令,cygwin,Cygwin,如何在Windows2003服务器机器上从Cygwin执行WindowsShutdown命令(shutdown-r) // windows xp shutdown -s -f now // windows 7 shutdown /r /t 0 它因windows版本而异。只需使用shutdown--help进行检查,并确定在您的特定版本上使用什么 从cygwin那里获得的关于我的案例的帮助页面(各不相同) 在我通过cygwin在Windows XP上关闭的版本中,现在无法识别。@Sridha

如何在Windows2003服务器机器上从Cygwin执行WindowsShutdown命令(shutdown-r)

// windows xp
shutdown -s -f now

// windows 7
shutdown /r /t 0
它因windows版本而异。只需使用
shutdown--help进行检查,并确定在您的特定版本上使用什么

从cygwin那里获得的关于我的案例的帮助页面(各不相同)


在我通过cygwin在Windows XP上关闭的版本中,
现在无法识别。@Sridhar Sarnobat在回答中说。。。这是不同的!只需运行
shutdown--help
并为特定版本查找正确的选项。
% shutdown --help
Usage: shutdown [OPTION]... time
Bring the system down.

  -f, --force      Forces the execution.
  -s, --shutdown   The system will shutdown and power off (if supported)
  -r, --reboot     The system will reboot.
  -h, --hibernate  The system will suspend to disk (if supported)
  -p, --suspend    The system will suspend to RAM (if supported)
      --help       Display this help and exit.
      --version    Output version information and exit.

`time' is either the time in seconds or `+' and the time in minutes or a
timestamp in the format `hh:mm' or the word "now" for an immediate action.

To reboot is the default if started as `reboot', to hibernate if started
as `hibernate', to suspend if started as `suspend', to shutdown otherwise.