Windows Task Scheduler showing me Error: No such file in directory while running an python exe file.

Ayush Atale 1 Reputation point
2021-07-07T09:37:26.303+00:00

Windows Task Scheduler showing me Error: No such file in directory while running an python exe file.
I have created a python exe file using pyinstaller when I create a task for this exe file, the exe file checks a excel(.xlsx) file in directory and write it in that file. So it runs when I do it manually, but when I do it by scheduling the task, it does not work.
PLease reply early.

Microsoft 365 and Office | Excel | For business | Windows
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Jenny Yan-MSFT 9,356 Reputation points
    2021-07-13T05:22:08.783+00:00

    Hi,
    1.Is the file path containing a mapped network drive?

    If so, please try to replace by "\server\share\folder\filename.ext" instead of the mapped drive.

    2.Here is a similar case when running scripts via windows task scheduler and the resolution shared is to add "cd customized drive" into the script since Task scheduler loads the C:\Windows by default as a directory.

    Details could be referred to:
    https://stackoverflow.com/questions/44525840/windows-task-scheduler-failed-to-open-stream-no-such-file-or-directory

    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.


    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.