Author Posts

March 23, 2015 at 10:45 am

Hi There- Need help to execute cmd file (batch file) from PowerShell script. Please let me know if anyone did this. Thank You, Dilip

March 23, 2015 at 10:48 am

You can execute .cmd or .bat files the same way you execute any other external program. For example:

c:\script.cmd Arg1 "Arg 2"

March 23, 2015 at 11:54 am

Thank you Dave. Just now I tried below and it worked.

[b][i]Start-Process -FilePath "C:\PSDemo\CopyFile.bat" "C:\Source" "C:\Destination" -WindowStyle Hidden[/i][/b]