Help converting a batch file to Powershell

Welcome Forums General PowerShell Q&A Help converting a batch file to Powershell

Viewing 2 reply threads
  • Author
    Posts
    • #251546
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      Hi, I’m a complete newbie to Powershell, so please forgive me if I use incorrect terminology.

      I have a simple batch file which runs a data extraction tool called Monarch, and applies a project export file. My employer is moving over to Win10 and locking down people’s ability to run batch files, but we can still run Powershell scripts.

      The single action/line I need to replicate in Powershell is:

      “C:\Program Files (x86)\Monarch\Program\Monarch.exe” “T:\Finance\Banking\_management_reporting\data_capture\_monarch_project_export_files\abi_dd_xref_audit.xprj” /pxall

      Thanks in advance for any help you can offer.

      Regards

       

    • #251558
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      Jon, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      When you post code, error messages, sample data or console output format it as code, please.
      In the “Text” view you can use the code tags “CODE“, in the “Visual” view you can use the format template “Preformatted“. You can go back edit your post and fix the formatting – you don’t have to create a new one.
      Thanks in advance.

      … and locking down people’s ability to run batch files, but we can still run Powershell scripts.

      That does not make any sense at all. And I can tell you why. Powershell is – just like CMD – a CLI. You can do the same with Powershell what you can do with CMD … and even more.

      And that’s even your solution. You command line should run just like it is in Powershell as well.

    • #251561
      Participant
      Topics: 0
      Replies: 81
      Points: 362
      Helping Hand
      Rank: Contributor

      Just put &, the call operator, in front of all that.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.