在windows | start | 執行 | command |
with support long file name
例子 c:\xcopy *.* /s/e/c/k/h/r/v d:\
Windows 有 3 種關閉 PC 的指令:
1. runonce.exe -q
2. rundll.exe user.exe,exitwindowsexec
3. rundll32 shell32.dll,SHExitWindowsEx n
1.runonce.exe -q
(執行 runonce.exe -q ,會有 15 秒左右的延遲,這是正常現象。)
2.rundll.exe user.exe,exitwindowsexec
(只會 Restart Windows)
3. rundll32 shell32.dll,SHExitWindowsEx n
其中,n 代表:
n = 0:重新啟動 Windows ﹙登出 Windows,不是重新啟動 PC﹚
n = 1:關機﹙Shutdown Windows﹚
n = 2:重新開機﹙關閉 Windows 再重新啟動 PC﹚
n = 4:強制關閉所有執行中的應用程式
﹙Windows 並不會通知應用程式而逕行關閉,由於是強制關閉,執行
中的應用程式資料並不會被儲存,使用時要注意這一點特性﹚
n = 8:結束作業系統,並關閉電源(僅支援使用 ATX 電源供應規格的 PC)
n = -1:-1 代表重新啟動檔案總管
若同時要執行多種功能,則將其 n 值相加。
例如:要結束作業系統,並關閉電源(8),然後關機(1)。﹙8 + 1﹚= 9 就是 n值。
rundll32.exe shell32.dll,SHExitWindowsEx 6(注意rundll32.exe 與 shell32.dll & SHExitWindowsEx 與 6 之間有一格空白。)