windows 带破折号或斜线的shutdown.exe参数?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2317043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
shutdown.exe parameters with dashes or slashes?
提问by Bertolt
I use a call of shutdown.exe
to reboot machines having different versions of Windows installed.
我使用调用shutdown.exe
来重新启动安装了不同版本 Windows 的机器。
For Windows XP the command is:
对于 Windows XP,命令是:
shutdown.exe -r -f -t 01
For other versions of Windows I use:
对于我使用的其他版本的 Windows:
shutdown.exe /L /R /C /Y /T:1
Now it seems, that the second command won't work on Windows XP. Does anybody know which versions of Windows support slashes and which dashes?
现在看来,第二个命令在 Windows XP 上不起作用。有谁知道哪些版本的 Windows 支持斜杠和哪些破折号?
EDIT:
编辑:
This is not an issue of wrong parameters. Here is a printout from an affected machine (German installation of Windows XP):
这不是参数错误的问题。以下是受影响机器的打印输出(Windows XP 的德国安装):
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\shutdown.exe /L /R /C /Y /T:1
Syntax: shutdown.exe [-l | -s | -r | -a] [-f] [-m \Computer] [-t xx]
[-c "Kommentar"] [-d up:xx:yy]
....
回答by Talvalin
Slashes dowork on XP, but as Poke said you need to use lower-case. Additionally, it appears that you can't use "/l" with "/r" (which makes sense since a shutdown and restart of the computer will log users off anyway), and you shouldn't use a colon after "/t"
斜线确实适用于 XP,但正如 Poke 所说,您需要使用小写字母。此外,您似乎不能将“/l”与“/r”一起使用(这是有道理的,因为计算机的关闭和重新启动无论如何都会使用户注销),并且您不应该在“/t”后使用冒号”
Eg:
例如:
shutdown /r /c /y /t 1
回答by poke
Use shutdown.exe /?
to find out how parameters are used, and which parameters are available. Looking at the help text (on Win7 atm), it seems that you need to lower-case those characters so they work correctly.
使用shutdown.exe /?
找出参数是如何使用的,哪些参数是可用的。查看帮助文本(在 Win7 atm 上),您似乎需要将这些字符小写,以便它们正常工作。
回答by ultrajohn
i usually use dashes... on winXP and thereon...
我通常使用破折号......在winXP上......