No permission to write a file from task scheduler?

蹲街弑〆低调 提交于 2019-12-13 03:43:47

问题


I got a batch file that will run a c++ program and output to a file with ">" redirection. This file is to be run by task scheduler.

I found out that when the batch file is ran from task scheduler, it claims "access is denied". The batch file runs fine until it reaches that ">" redirection part. (I see that the whole batch can run finely without ">") I have tried running the task scheduler as an administrator as well, but I still got "access is denied".

Is there a way around this?


回答1:


There may be quite a few reasons of it, first check below points:

  1. Check whether the user who has scheduled batch script to run in Task scheduler has admin access on the system or not.

  2. Give that user full Share/NTFS permissions on the "RedirectedFolders" and all of the sub folders as well.you can manually propagate all permissions down to the folders.

  3. The user should have read and write permissions along with full control to the "RedirectedFolders" .



来源:https://stackoverflow.com/questions/20744604/no-permission-to-write-a-file-from-task-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!