0

I need to make these commands run all together. So i am going to make them run as a batch file then call each line individually to make a pop up message appear on the screen.

But I have tried different methods of trying to get them to run as one single line but cant seem to get it working - any help would be appreciated

Powershell

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

would be great if you guys could help

Mark
  • 3,273
  • 2
  • 36
  • 54
  • Sorry the code didnt post fully powershell^ [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")^ [System.Windows.Forms.MessageBox]::Show("We are proceeding with next step." , "Status") – John Williams Aug 03 '16 at 12:40
  • Looks just like the same question over here. http://stackoverflow.com/questions/25836547/powershell-run-message-box-from-cmd – Squashman Aug 03 '16 at 13:01
  • "Run all together" means what? – Austin T French Aug 03 '16 at 14:32

2 Answers2

0

In dos, the ampersand & sign can be used to run multiple commands, in sequence. For example:

cd C:\ & echo foo

Although if you're just running powershell commands why write them to a batch file? Just write a powershell script and run it from command prompt.

See this post: How to run a PowerShell script from a batch file

Community
  • 1
  • 1
Verbal Kint
  • 425
  • 1
  • 3
  • 20
0

If you separate your PS commands by a semi-colon you can run multiple commands from a one-liner from the shell.

E.g.

echo "foo"; echo "bar"
jurgenb
  • 472
  • 4
  • 11