What exactly does shutdown -y do?

I tried some random options after the shutdown in PowerShell 2.0 when I came across shutdown -y . All that seems to be logging out. if any other random letter is used (this is not a valid parameter), nothing happens. For example: shutdown -b

My question is: does shutdown -y do something special?

I could not find documentation about this.

+5
source share
2 answers

The Windows 2000 documentation contains the following:

/ y: use this switch to force the answer "yes" to all requests from the computer.

Thus, it seems that with -y or /y without any other switches, you are executing shutdown.exe default behavior, which means logging out of the user, as well as forcing any confirmation confirmations to date.

+3
source

Shutdown not a PowerShell team. This is the same shutdown.exe that also works in CMD.

Interestingly, the -y command is not mentioned in the documentation . As Mark Wargg found out, he used the answer β€œyes” to remote shutdown. Thus, if no other parameters are specified, the default action is taken (user logoff).

Another question: why did you try to use random parameters? Follow the document and you are unlikely to encounter any unexpected behavior.

+1
source

Source: https://habr.com/ru/post/1271558/


All Articles