What exactly does “shutdown -y” do? [closed]

左心房为你撑大大i 提交于 2019-12-05 06:04:25

The Windows 2000 documentation states the following:

/y: Use this switch to force a "yes" answer to all queries from the computer.

So it looks like by using -y or /y with no other switches you are doing the default behaviour of shutdown.exe, which is to logoff the user while also forcing any confirm prompts to be acknowledged with yes.

Shutdown is not exactly a PowerShell command. It's the same shutdown.exe that also works in CMD.

Interestingly, the -y command is not mentioned in the documentation. As Mark Wragg found out, it's used to force a "yes" answer for remote shutdown. So, if no other parameters are specified, the default action (logoff user) is executed.

Another question: Why were you trying random parameters? Follow the docu and you're less likely to encounter any unexpected behavior.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!