How to fix window task scheduler issue

Pradip Chavda 0 Reputation points
2024-07-23T16:45:26.2966667+00:00

Hello,

I am stuckup at one place and need your expert advice.

I have created .bat file for copy and paste file from different locations.

  • Source file location: Network Drive
  • Destination file location : BOX (cloud storage)
  • .Bat file location: System Desktop

This .bat file is working fine while clicking manually but it is not working while task setup in Task Scheduler.

I have tried majority of permutation combination but .bat file not working in task scheduler.

Hope i am clarifying issue.

Request you to give your expert opinion.

Thank you very much in advance.

Regards,

Pradip chavda

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,484 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 34,346 Reputation points
    2024-07-24T00:57:35.1966667+00:00

    The task scheduler does a user impersonation, not a full desktop logon. If you are referencing a mapped network drive letter, it may not be available. Use the UNC path, \\ServerName\ShareName\FolderName.

    In the scheduled task, set it to execute program cmd.exe. In the arguments field set it to run the .bat file like this.

    /c C:\YourScriptsFolder\YourBatFileName.bat 1>C:\YourScriptsLogFolder\YourBatFileName.log 2>&1
    

    In your .bat file, add DIR commands to both the source and destination folders to verify that the .bat file can access your network folders.

    Review the .log file and look for errors.

    0 comments No comments

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.