I have a custom type .acust which is associated with a homemade application. Scheduling works fine as long as it is "Run only when user is logged on" but doesn't work as a service "Run whether user is logged on or not".
An obvious workaround is that instead of running a file .acust trigger the task with the application and passing the xxxx.acust in parameter but I would still like to make the association work when the task run as a service. Is this possible ?
Issue is happening in windows server 2012 and windows 10 at least. It was not occuring on windows 2008
No it's not possible to run a non-executable file as a service, since it should interact with service manager, providing its state etc.
But you still can achieve what you need by passing the filename of your .acust script to the program executable.
You can't actually make a service using "Task Scheduler", so you'll need to download NSSM - the Non-Sucking Service Manager. Unpack the executable file somewhere safe (I recommend unpacking it to c:\Windows), since new services would be launched by that file. After that issue the following command (assuming
nssm.exe
is in the system PATH)nssm install RunAcust
(which should open an nssm window), where you will be able to specify everything you need).