Task Scheduler Running .bat but not executing code

%3CLINGO-SUB%20id%3D%22lingo-sub-2707995%22%20slang%3D%22en-US%22%3ETask%20Scheduler%20Running%20.bat%20but%20not%20executing%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2707995%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20set%20up%20a%20task%20in%20the%20Windows%20Task%20Scheduler%20that%20will%20run%20a%20.bat%20file%20that%20runs%20python%20code%20to%20kick%20off%20an%20API%20and%20then%20generate%20.csv%20files.%26nbsp%3B%20When%20I%20run%20the%20.bat%20file%20manually%2C%20it%20does%20everything%20I%20want%20it%20to%20do.%26nbsp%3B%20However%2C%20when%20I%20try%20and%20run%20it%20via%20the%20Task%20Scheduler%2C%20it%20doesn't%20do%20anything.%26nbsp%3B%20The%20history%20for%20the%20task%20says%20that%20the%20.bat%20file%20completed%2C%20but%20the%20API%20was%20not%20triggered%20and%20the%20.csv%20files%20were%20not%20created.%26nbsp%3B%20What%20could%20I%20be%20doing%20wrong%3F%26nbsp%3B%20I%20don't%20think%20it%20can%20be%20a%20permissions%20issue%2C%20as%20I%20said%20I%20can%20run%20the%20.bat%20manually%20as%20the%20user%20running%20the%20tasks%20and%20it%20works.%26nbsp%3B%20Attached%20is%20the%20snapshot%20of%20the%20.bat%20that%20I'm%20trying%20to%20run.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22bat%20snapshot.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F307321i7172ADE370E9F34B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22bat%20snapshot.png%22%20alt%3D%22bat%20snapshot.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am trying to set up a task in the Windows Task Scheduler that will run a .bat file that runs python code to kick off an API and then generate .csv files.  When I run the .bat file manually, it does everything I want it to do.  However, when I try and run it via the Task Scheduler, it doesn't do anything.  The history for the task says that the .bat file completed, but the API was not triggered and the .csv files were not created.  What could I be doing wrong?  I don't think it can be a permissions issue, as I said I can run the .bat manually as the user running the tasks and it works.  Attached is the snapshot of the .bat that I'm trying to run.

bat snapshot.png

0 Replies