ESP Workload Automation

 View Only

  • 1.  Command File not found error when trying to kick off PowerShell script

    Posted Jun 10, 2026 10:43 AM
    Edited by Keith Grizzell Jun 10, 2026 10:44 AM

    Hello, we have several servers that have PowerShell scripts on them that we kick off using ESP. I had a new server built for a new application and had the System agent installed on it. When trying to kick off the PowerShell I get the command file not found error. Out of curiosity I added a bat file to the same folder and I am able to successfully execute the bat file. Anyone have any ideas on why I can kick off the bat file successfully but not the PowerShell script?

    JOB: This is our standard format I followed same as all our other jobs

    NT_JOB KEITHTST.PLMDLTST HOLD                      
     AGENT VMJMBAM01                                   
     USER GMCC\ESPADMINNONPRD                          
     CMDNAME C:\POWERSHELL\PWSH.EXE                    
     ARGS /C D:\CYB_JOBS\esp_powershell_batch_scripts\+
     BathcScript1.PS1 +                                
     -BATCHNAME ACTIVITY ESCALATION +                  
     -NUMWAITSECONDS 300 -NUMMAXSTATUSCHECKS 10        
     RUN DAILY                                         
     EXITCODE 0 SUCCESS                                
    ENDJOB  

    Error in log for test job:

    SPRODID.KEITHESP scheduled, for Job KEITHTST.PLMDLTST2 in Appl KEITHESP.13
    PARMS: ESPTRUSR(GOPKXG)ESPTRTYPE(P)RESUB_USER()ESPLONGNAME('KEITHTST.PLMDL
    . KEITHTST.PLMDLTST2/KEITHESP.136/MAIN State READY Status(Agent Notified) 
    VMJMBAM01 KEITHTST.PLMDLTST2/KEITHESP.136/MAIN State SUBERROR Failed Cmpc(
    Status("Command file not found") JobLogId(F201A3234187EC43921CBE055289B0BB
    Host(VMJMBAM01)        

    Success for bat file from same folder:

     APPL KEITHESP.136 JOB KEITHBAT.TST RELEASED BY GOPKXG                    
    APPL KEITHESP.136 JOB KEITHBAT.TST READIED                               
    SPRODID.KEITHESP scheduled, for Job KEITHBAT.TST in Appl KEITHESP.136, Un
    PARMS: ESPTRUSR(GOPKXG)ESPTRTYPE(P)RESUB_USER()                          
    . KEITHBAT.TST/KEITHESP.136/MAIN State READY Status(Agent Notified)      
    VMJMBAM01 KEITHBAT.TST/KEITHESP.136/MAIN State EXEC SetStart Status(Execu
    Jobno(15900) JobLogId(5E028BB7993B61F5A56A46F455B86255E55B905F)  User(VMJ
    VMJMBAM01 KEITHBAT.TST/KEITHESP.136/MAIN State COMPLETE Cmpc(0) SetEnd   
    JobLogId(5E028BB7993B61F5A56A46F455B86255E55B905F)  User(VMJMBAM01) Host(
    APPL KEITHESP.136 JOB KEITHBAT.TST Now Complete                                                                                                                     



    ------------------------------
    [Keith Grizzell]
    [Infrastructure Specialist]
    [Grange Insurance]
    [Columbus] [Ohio]
    ------------------------------



  • 2.  RE: Command File not found error when trying to kick off PowerShell script

    Broadcom Employee
    Posted Jun 11, 2026 07:23 AM

    Two obvious things to check

    1. Does the file "C:\POWERSHELL\PWSH.EXE" exist on the node VMJMBAM01?
    2. Is "/C" the correct way to specify that what follows is the script to run


    ------------------------------
    Thanks in advance
    Chris
    ------------------------------



  • 3.  RE: Command File not found error when trying to kick off PowerShell script

    Posted Jun 11, 2026 09:14 AM

    If you have access to the server you can run the following command to find the path:

    where.exe pwsh




  • 4.  RE: Command File not found error when trying to kick off PowerShell script

    Posted Jun 11, 2026 10:37 AM

    Thanks guys. I do have access to the server and as mentioned by Rick the C:\POWERSHELL\PWSH.EXE does not exist on my new server. I compared to existing server and the .EXE is on C:drive of existing server. I raised ticket with my server team to get this fixed up. Thanks for the direction



    ------------------------------
    [Keith Grizzell]
    [Infrastructure Specialist]
    [Grange Insurance]
    [Columbus] [Ohio]
    ------------------------------



  • 5.  RE: Command File not found error when trying to kick off PowerShell script

    Posted Jun 11, 2026 09:49 AM

    You can also open a Command prompt enter powershell and type:

    echo $PSHOME