I am trying to schedule a task using Task Scheduler on Windows. It is for a console app written with .net Core. I have created a task, set a trigger and created a new action.
When I manually run it, I get a 'Last Run Result' of 'The system cannot find the file specified. (0x80070002)'. I have ensured that the user account running the task has access to the database on SQL Server.
I ran it in the command line as dotnet "C:\Program Files\UTDT_Database_Update\publish\UTDT_Database_Update.dll" and it worked successfully.
My 'Edit Action' is as follows.
Program/Script: dotnet
Add arguments (optional): UTDT_Database_Update.dll
Start in (optional): C:\Program Files\UTDT_Database_Update\publish\
I haven't found any solutions that work yet. Anyone have any ideas?
Solution was to create a batch file (.bat) that contained the following: **@ECHO OFF dotnet "C:\Program files\UTDT_Database_Update\publish\UTDT_Database_Update.dll" **
Program/Script: UTDT_Database_Update_batch.bat
Add arguments: empty
Start in: Location of .bat file
This made it run. Still not sure why original task didn't work but this at least gets it to run.
User contributions licensed under CC BY-SA 3.0