2014-01-12 25 views
-1

我正在Visual Studio 2012中編寫Visual Basic應用程序以打開計算機。 我已經使用的語法像System.Diagnostics.Process.Start(「Shutdown」,「-s」)在Visual Basic中不起作用

1. System.Diagnostics.Process.Start("Shutdown", "-s") 
2.System.Diagnostics.Process.Start("Shutdown", "/s") 

3. Process.Start("shutdown", "/s /f /t 01") 
4. Shell("shutdown -s -t 00") 

但所有而不是關閉再重新運行相同的應用程序和計算機不關機only.what可能是因爲它的解決方案,使其在期待

工作

感謝

+1

* reruns *是什麼意思?它只會再次運行一次嗎?也許你的exe文件被稱爲'關機'也? –

+0

@KonradKokosa ...是的....你是對的..我重命名文件.. ,我得到它的工作... thanx很多 – nikhil

回答

1

將您的應用程序可執行文件shutdown重命名爲其他內容,因爲在名稱爲shutdown的情況下,它會隱藏系統範圍shutdown命令。

相關問題