2016-08-03 81 views
0

我需要使這些命令一起運行。所以我要讓它們作爲一個批處理文件運行,然後分別調用每一行來在屏幕上顯示彈出消息。我如何使所有這些命令一起運行

但我已盡力試圖讓他們作爲一個單獨行不同的方法,但不能似乎得到它的工作 - 任何幫助,將不勝感激

Powershell的

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 
[System.Windows.Forms.MessageBox]::Show("We are proceeding with next step." , "Status") 

如果將是巨大的你們可以幫助

+0

對不起代碼didnt交充分 的powershell^ [System.Reflection.Assembly] :: LoadWithPartialName( 「System.Windows.Forms的」)^ [System.Windows.Forms.MessageBox] ::顯示(「我們正在進行下一步」,「狀態」) –

+0

看起來就像這裏的同樣的問題。 http://stackoverflow.com/questions/25836547/powershell-run-message-box-from-cmd – Squashman

+0

「一起奔跑」意味着什麼? –

回答

0

在dos中,符號&符號可以用來依次運行多個命令。例如:

cd C:\ & echo foo 

雖然如果您只是運行powershell命令,爲什麼要將它們寫入批處理文件?只需編寫一個powershell腳本並從命令提示符運行即可。如果你通過一個分號,你可以從殼一個班輪運行多個命令分開你的ps命令How to run a PowerShell script from a batch file

0

看到這個職位。

E.g.

echo "foo"; echo "bar"