0

I am trying to run task scheduler on my local pc (windows 10), I have set it up to run a exe file stored on my C drive daily, but it doesn't run when I set it to "run whether user is logged on or not".

It works fine when set to "Run only when user is logged on", but I need it to run when I am not logged on.

Currently, if I press run it instantly stops running and says "ready" but nothing has been executed. the last run result is 0x0

Any ideas on what could fix this?

Actions is enter image description here

General is enter image description here

History is enter image description here

Settings is enter image description here

Triggers is enter image description here

21
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Oct 9 at 10:16
  • logon as batch permission has to be granted for the user in secpol.msc . Also the correct password must be entered in the task properties Oct 9 at 10:40
  • @DavidTrevor thank you for your comment, the account I am using has logon as batch permissions, and in regards to passwords I can confirm the password is correct.
    – Steve
    Oct 9 at 10:52
  • not sure what your .exe is doing, it might operate in a way that expects a logged on user session? And simply terminates if called from task scheduler. Explaining the 0x0 success error code Oct 9 at 11:11
  • The .exe is a PowerShell execute (ps1) that I converted to an exe. Pretty much all it does is pull stats from exchange. I have tried with a simple command like "write-host" and even that doesn't work.
    – Steve
    Oct 9 at 12:00

1 Answer 1

1

Does the script output anything? It won't show anything to a shell if it's running non-interactively and will terminate immediately. If there is no exit code returned task scheduler will assume it ran successfully (exit code 0).

Add some verbosity to see which step in the task is failing.

E.g. $Data | Out-File C:\Temp\Data.log

If Data.log is blank then it failed to pull the data, then your problem is isolated to access/privileges to exchange and the task runs fine.

I saw it stated the password is fine, I'm assuming that means you checked the security event logs and saw a successful authentication and access to the resources though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .