10
如何在Windows 2003服務器機器上從Cygwin執行Windows關機命令(shutdown -r)?如何在Windows中執行cygwin中的關機命令
如何在Windows 2003服務器機器上從Cygwin執行Windows關機命令(shutdown -r)?如何在Windows中執行cygwin中的關機命令
// windows xp
shutdown -s -f now
// windows 7
shutdown /r /t 0
它從Windows版本到版本不同。只需使用shutdown --help
進行檢查,並找出在特定版本上使用什麼。
而從我的案件cygwin拾起幫助頁面(變化)。
% 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.
在我通過Windows XP上的cygwin關機的版本中,'now'是無法識別的。 – 2016-12-17 02:25:27
@ Sridhar-Sarnobat喜歡在回答中說...它變化!只需運行'shutdown --help'並查找特定版本的正確選項。 – Frankie 2016-12-17 04:25:22