开发者

win2008 service wants to delete file : permission denied [closed]

开发者 https://www.devze.com 2023-03-05 07:41 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Closed 7 years ago.

  • Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
  • This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topi开发者_C百科c here, this one was resolved in a way less likely to help future readers.
Improve this question

I have an old VB6 service that works on a number of Excel files. The service looks for files in a given directory, opens them and reads the contents. If everything works well the file gets a new extension ".ok", or ".err" if something went wrong.

The rename doesn't work, I get a permission denied error. So I tried copy + delete as two operations. The copy works fine, but I can't delete the file.

I'm using Windows2008R2 here. I put the files in a folder and gave "Everybody" full access (although I can't find an option that says "delete"). I even changed the file owner to "Everybody" ...

I even ran the service as Administrator who shows "Delete" in the effective rights tab.

What am I missing?

Update : never mind. I found that one of the processes working on the Excel file has not closed the FileStream correctly. Works now :)


Check whether you have created the windows service to run as local service or not. If not change it to run in local service.

Also give the folder with files full permission for the account you logged in.


Really, really make sure you're not missing some open FileStream or something! (see my edit in OP)

0

精彩评论

暂无评论...
验证码 换一张
取 消