6

I have scheduled a task to be run at system startup. But its not working. When I run the task manually, it is working. Below are the screenshots of the settings.

enter image description here

enter image description here

What have I done wrong here? This task executes a bat file that launches a process. Btw, the result of last execution is shown as successful though.

  • What is "Kube Watchdog"? Google only finds Kube Studios on BBC Watchdog. What kind of process is it and what it is supposed to do when you launch it at system startup? – Esa Jokinen May 9 '17 at 7:36
  • It is a process that monitors some of the windows services we have developed. When I run it manually from task scheduler it works fine. Just that system startup is not happening – mayooran May 9 '17 at 7:53
  • Try removing the checkmark from "Do not store password" – Mikael Dyreborg Hansen May 9 '17 at 9:04
  • It's 2 years later and I haven't been able to find a solution for this. 'Run whether use is logged on or not' apparently doesn't work? – Daniel Scott Jan 21 at 22:38
1

Your program isn't a background script or a service. It is a GUI program that should be run as a user in graphical environment. Therefore you should not launch it as a scheduled task on startup but on user login.

As the program is in your own development, you could revise its design: should it have a background service doing the background operations and separated GUI for configuration / monitoring?

  • I can have it on user login as well. But that would mean that I need to have the login credentials of every machine that this is installed. It would be rather nice to have it on startup is what I thought. Besides these, why wouldn't this created task work? I tried simply writing to the file on startup, that too doesn't work – mayooran May 15 '17 at 2:32
1

You are executing this Task with "VM" user privileges. Does "VM" account have "Run as a batch Job" rights?

How are you setting up your scheduled task, through local Task Scheduler or through DC GPO Preferences. What I've noticed is if the task is created through DC GPO Preferences is the same ... task will never execute (no matter what you are executing, VBS, PowerShell, CMD, EXE) if the only trigger is "At startup". I must create my Tasks with two triggers:

  1. At task creation/modification

  2. At startup

Now the task executes correctly every time I restart my computers.

REMARK

  1. This only applies if the Tasks are created through GPO Preferences on the DC side.

  2. This only applies for the trigger "At startup". As far as I have seen, every other trigger works fine.

  3. Be sure not to use "Replace" mode when creating this GPO Preference if you do not want for the Task to execute every time computer refreshes it's GPO's. In "Replace" mode during refresh the Task is being recreated and the trigger is "At task creation/modification". Use "Update" mode instead. Also this is where you see one problem with this workaround ... you can not create the Task in this way that should delete itself once the Computer is no longer part of Domain because those kind of Tasks require the "Replace" mode.

0

Why don't you run this batch file as a windows service? Is there any particular reason? FYI: http://nssm.cc/usage

  • Yes that's a valid question. This process is supposed to launch an application for which the UI should be visible. That's why this has to run as an independent process and not a service – mayooran May 9 '17 at 9:44
  • So how can it run a GUI when the computer has only just started and nobody is logged in? Are you sure you don't want to run at user logon instead? – Dan May 9 '17 at 10:17
  • But still, why is this not working? What I've done – mayooran May 9 '17 at 10:33
0

I also have problems with Win 10 task scheduler, and for some reason I have same behaviour as you. Task is marked as successfully executed but the program/script does not run.

In order to solve this, at least it works for me, try placing a shortcut of the script as a startup program in %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup.

You can also make this shortcut be runned with highest privileges (Admin). I've found this to work better than task scheduler, at least for my software/scripts. Some of them run with GUI and some without GUI, but both of them run fine under Startup folder.

PD: %APPDATA% is an system variable, the full path should look like the following:

C:\Users\YourUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
0

Is fast boot enabled in the BIOS? Win10 uses restart in a similar fashion to sleep mode if fast boot is enabled, so is not a true 'restart'.

0

I struggled a while with the same problem. In my case, the problem was the setting "Start the task only if the computer is on AC power".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.