Run Batch File With PowerShell

Welcome Forums General PowerShell Q&A Run Batch File With PowerShell

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

 
Participant
2 years ago.

  • Author
    Posts
  • #59818

    Participant
    Points: 0
    Rank: Member

    Hello,

    New to Powershell but I am trying to kick off a batch file with a Powershell script, I have included the script below with the servers taken out. It is not kicking off the the .bat file, can you tell me why?

    start-process "\\server\folder\folder\_batch.bat"

    Everything looks good to me.

    Thanks

    Larry

  • #59821

    Participant
    Points: 269
    Helping Hand
    Rank: Contributor

    You should read the complete help for the cmdlet Start-Process including the examples.

    Get-Help Start-Process -Full
    Start-Process -FilePath $Env:ComSpec -ArgumentList '/c \\server\folder\folder\_batch.bat'

    A batch file is not an executable

  • #59839

    Participant
    Points: 350
    Helping Hand
    Rank: Contributor

    Why do you need batch if you are launching Powershell?

The topic ‘Run Batch File With PowerShell’ is closed to new replies.