Как выполнить команду отключения из cygwin в Windows - PullRequest
10 голосов
/ 24 февраля 2011

Как выполнить команду выключения Windows (shutdown -r) из Cygwin на компьютере с сервером Windows 2003?

1 Ответ

12 голосов
/ 19 октября 2011
// 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.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...