2010-02-23 35 views
1

我使用shutdown.exe的呼叫重新啓動安裝了不同版本Windows的計算機。帶有破折號或斜槓的shutdown.exe參數?

對於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] 

.... 
+2

不是編程相關的?屬於超級用戶? – 2010-02-23 09:49:17

+0

我從另一個程序調用命令,所以我想我不妨在這裏發佈它。 – Bertolt 2010-02-23 10:05:19

+1

您應該使用記錄的API,'InitiateSystemShutdownEx()' – MSalters 2010-02-23 10:07:28

回答

6

斜槓在XP上工作,但由於Poke說你需要使用小寫。此外,看起來你不能在「/ r」中使用「/ l」(這很有意義,因爲關機和重新啓動計算機都會將用戶關閉),並且你不應該在「/ t 「

如:

shutdown /r /c /y /t 1 
+0

很好的回答。謝謝。 – Bertolt 2010-02-23 10:17:19

1

我通常使用破折號...在WinXP和其...

+0

相同 - 總是破折號。 – slugster 2010-02-23 09:41:20

2

使用shutdown.exe /?找出參數是如何使用,以及哪些參數可用。查看幫助文本(在Win7 atm上),似乎需要將這些字符小寫,以便它們正常工作。