Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

Running executable on W2019 Server

I need to run an executable on a scheduled basis. This executable requires a single parameter which will always be a string. When I run this executable manually it runs successfully. However when scheduling to run automatically under tasks scheduler it does not run successfully and returns error 0xE0434352. Under Actions I have

G:\GPShares\Automation\ImportRoutines\Import.Files.exe

Under arguments is "SIG"

I have other Powershell scripts that run just fine. Is there something different I need to do for other executables?

Avatar of oBdA
oBdA

Could it be that G: is a mapped network drive?
If so, replace the path to the executable with the UNC, and make sure that the account the task is running under has permissions to access the path.
\\<Server>\<GShare>\GPShares\Automation\ImportRoutines\Import.Files.exe

Open in new window

Avatar of rwheeler23

ASKER

G is a physical drive on this server. I even tried running the task ask a batch file. The error code I get now is 0x1. The domain account running this job is the same one running the powershell scripts. Is there a way to run an executable using powershell?
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you're directly calling the executable from the scheduled task, powershell is not involved here.
So the things you look at for any task are:
 - permissions (does the account have permissions to run as a task? does it have access to the executable and any locations that the executable will need to access?)
 - environment (can include environment variables, mapped drives)
 - can the process run in a non-interactive session?  (some things require an interactive session - if it runs when you have "Only run when user is logged on" checked, but not when you have "Run whether user is logged on or not" checked)