【发布时间】:2010-02-23 09:38:51
【问题描述】:
我调用shutdown.exe 来重启安装了不同版本Windows 的机器。
对于 Windows XP,命令是:
shutdown.exe -r -f -t 01
对于我使用的其他版本的 Windows:
shutdown.exe /L /R /C /Y /T:1
现在看来,第二个命令在 Windows XP 上不起作用。有谁知道哪些版本的 Windows 支持斜杠和哪些破折号?
编辑:
这不是参数错误的问题。这是受影响机器的打印输出(德国安装的 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]
....
【问题讨论】:
-
与编程无关?属于超级用户?
-
我从另一个程序调用命令,所以我想我不妨把它贴在这里。
-
您可能应该使用记录在案的 API,
InitiateSystemShutdownEx() -
投反对票?只需移动到超级用户即可。
标签: windows batch-file shutdown