Dear Mr. Chandrawanshi,
Thank you for reaching out. We understand you're experiencing an issue with Task Scheduler on Windows Server 2022 Datacenter, where a batch file intended to copy files from an Azure file share works manually and when the user is logged on, but fails silently when set to run regardless of login status.
This behavior is often related to network drive access and user context limitations. When using the “Run whether user is logged on or not” option, the task runs in a non-interactive session, which may not have access to mounted network shares—even with domain admin credentials.
To resolve this, we recommend the following best practices:
Use UNC paths (e.g., \\storageaccount\sharename) instead of mapped drives in your batch file.
Ensure the task is set to “Run with highest privileges”.
Confirm that the domain account has explicit permissions to access both source and destination folders.
If the Azure file share requires authentication, consider embedding credential handling in the script using net use with secure credential storage.
I hope this helps. Just kindly tick Accept Answer that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
Best regards,
Domic Vo