locked
Running PsFCIV from a bat file RRS feed

  • Question

  • Goal to allow end user to click a file and create checksums or to click another file and verify the checksum.

    My approach was a bat file - something I know about - someone has suggested I stick to powershell and forget the bat file.

    Below is my attempt at the bat file approach. 

    I can not get the syntax right.  Help Please.  I have tried many forms of the following.  This results in no errors and no data.

    My bat file contains

    PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File "C:\PsFCIV\PsFCIV.ps1 .Start-PsFCIV  -Path c:\Tsk -XML .\Tskdb.xml -Rebuild"  ' -Verb RunAs}" > ".\tsk.log"

    pause

    Any help on either approach would be greatly appreciated.

    Glenn Benscoter 

    Tuesday, August 25, 2015 12:23 PM

Answers

  • Don't try to run powershell.exe as a command from the cmd.exe prompt. (Why do you think you need to do this?)

    Start up a PowerShell window instead and just type the command you want to run at the PowerShell prompt.


    PS C:\> C:\PsFCIV\PsVCIV.ps1 ... <whatever parameters you need>
    


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Bill_Stewart Wednesday, September 2, 2015 6:26 PM
    • Marked as answer by Bill_Stewart Tuesday, September 29, 2015 3:39 PM
    Tuesday, August 25, 2015 2:30 PM

All replies

  • What is it that you are trying to do? What you have posted makes absolutely no sense.


    \_(ツ)_/

    Tuesday, August 25, 2015 1:19 PM
  • Don't try to run powershell.exe as a command from the cmd.exe prompt. (Why do you think you need to do this?)

    Start up a PowerShell window instead and just type the command you want to run at the PowerShell prompt.


    PS C:\> C:\PsFCIV\PsVCIV.ps1 ... <whatever parameters you need>
    


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Bill_Stewart Wednesday, September 2, 2015 6:26 PM
    • Marked as answer by Bill_Stewart Tuesday, September 29, 2015 3:39 PM
    Tuesday, August 25, 2015 2:30 PM