shutdown.exe parameters with dashes or slashes?

喜欢而已 提交于 2019-12-10 18:38:52

问题


I use a call of shutdown.exe to reboot machines having different versions of Windows installed.

For Windows XP the command is:

shutdown.exe -r -f -t 01

For other versions of Windows I use:

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?

EDIT:

This is not an issue of wrong parameters. Here is a printout from an affected machine (German installation of 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]

....

回答1:


Slashes do work 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"

Eg:

shutdown /r /c /y /t 1



回答2:


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.




回答3:


i usually use dashes... on winXP and thereon...



来源:https://stackoverflow.com/questions/2317043/shutdown-exe-parameters-with-dashes-or-slashes

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