a collection of technical fixes and other randon stuff

Spodworld

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Running a published command line executable as a Scheduled task in Windows 7

If you experience any of the following errors while trying to run a scheduled task:

  • Task Scheduler failed to start instance "{xxxxxxxx-8xxxa43-xxx-xxxx-xxxxxxxxxx}" of "myprogram"  task for user "mydomain\myuser" . Additional Data: Error Value: 2147942593.

It may be that you are using publishing in visual studio to deploy this.

How to fix it:

First of all , once published you need to run the myapp.application file for it to be installed.

Then you need to consider that this installation puts the application elsewhere. If you dont need auto updating, then teh best bet is to point your scheduled task to the installed location.

Typically this would be in...

C:\Users\myuser\AppData\Local\Apps\2.0\xxxxxxxxxxxxxxxxxxxxxxxxxx\xxxxxxxxxxxxxxxxxx

Where the user is the same as that you installed it/will be runnning it and teh xxxxxx is some random crap.

Best way to find this is to search for a file in your app from  C:\Users\myuser\AppData\Local\Apps\2.0 and then right click on the file and select 'open location'

This solution worked for me, however our solution did not require auto updating which some of you might need.

Any advice on getting the main .application file call would be great. I suspect it will permission based problems.