2

I am trying to run one batch file using powershell. It required property file to start the APP as without it is failing.

Below are the commands which i have tried but dint get success.

cmd.exe /c ' C:\designer\5.7\bin\designer.bat -p C:\designer\5.7\bin\designer.prop

or

& "C:\designer\5.7\bin\designer.exe" "C:\designer\5.7\bin\designer.prop"

or

& "C:\designer\5.7\bin\designer.exe" C:\designer\5.7\bin\designer.prop

Could someone suggest more on it?

Joey
  • 344,408
  • 85
  • 689
  • 683
sharsour
  • 119
  • 2
  • 2
  • 4
  • possible duplicate of [How to call batch script from Powershell?](http://stackoverflow.com/questions/4384814/how-to-call-batch-script-from-powershell) – WhiteKnight Mar 26 '14 at 16:02

2 Answers2

5

You should be able to use just

C:\designer\5.7\bin\designer.bat -p C:\designer\5.7\bin\designer.prop

Your latter two examples should work as they are.

Joey
  • 344,408
  • 85
  • 689
  • 683
0

x.vbs file content following:

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd /K CD **path** & **x.bat** **parameter**"
Set oShell = Nothing

powershell script following :

Start-Process x.vbs
MahmutKarali
  • 339
  • 4
  • 8