locked
Executing batch file on server RRS feed

  • Question

  • Hi, 

    I have a batch file placed on my server machine. I want to run this batch on server from remote machine using powershell. Please help me in this regard. 

    Thanks

    Shahid

    • Moved by Bill_Stewart Friday, July 27, 2018 8:17 PM Unanswerable drive-by question
    Tuesday, March 27, 2018 12:16 PM

All replies

  • Research PowerShell remoting. I would recommending taking some time to learn PowerShell.

    Learn PowerShell                     Script Requests

    -Remember to mark the correct response as the answer-

    Tuesday, March 27, 2018 12:26 PM
  • Try this 
    $credentials  = Get-Credential
    Invoke-Command -ComputerName "Your Server" -Credential $credentials -ScriptBlock { & C:\temp\yourscript.bat}
    Replace "C:\temp\yourscript.bat" by the local path 
    Tuesday, May 15, 2018 10:15 AM