Executing Batch File Using PowerShell

Welcome Forums General PowerShell Q&A Executing Batch File Using PowerShell

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
3 years, 11 months ago.

  • Author
    Posts
  • #23609

    Participant
    Points: 0
    Rank: Member

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

  • #23611

    Member
    Points: 0
    Rank: Member

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

    c:\script.cmd Arg1 "Arg 2"
    
  • #23614

    Participant
    Points: 0
    Rank: Member

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

    Start-Process -FilePath "C:\PSDemo\CopyFile.bat" "C:\Source" "C:\Destination" -WindowStyle Hidden

The topic ‘Executing Batch File Using PowerShell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort