sharsour
sharsour

Reputation: 119

How to run batch file using powershell

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?

Upvotes: 2

Views: 10494

Answers (2)

MahmutKarali
MahmutKarali

Reputation: 365

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

Upvotes: 0

Joey
Joey

Reputation: 354356

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.

Upvotes: 5

Related Questions