7

I don't know if this is the right place to ask this question, but I am going to ask it anyway.

I have a frequent problem when I try to rename one of my folders; it says access is denied. I have full administrative rights on my computer. The problem occurs only when I try to do it via command prompt or batch files. I can manually rename the folder with no problems whatsoever. But I need to be able to rename it using the ren command. It is an irritating problem, and I have heard other people having the same problems. They usually fix it by re-taking ownership of the folder and restarting the computer. This works for me, but I hate having to do this every time. Is there a permanent solution that I can do to stop this problem? Also, when this problem occurs, it happens to all folders; I can't rename any of them using the ren command.

| improve this question | |
14

The answer is quite simple:

Windows does not permit deletion or renaming a directory/folder which is

  • the current directory of any running process (application/service) like the command process, or
  • any subdirectory of the directory to rename is the current directory of any running process, or
  • any file is opened in the directory to rename or any of its subdirectories by any process with OF_SHARE_DENY_READ, OF_SHARE_DENY_WRITE, OF_SHARE_EXCLUSIVE used on opening the file.

In other words as long as the directory itself or any file or subdirectory in this directory or its subdirectories is in use by any application, Windows denies renaming or deleting the directory.

On Unix/Linux it is possible to delete or rename a directory while it is in use by 1 or more running processes. The running *nix process has to handle the special use case that the directory or file just accessed successfully a millisecond before does suddenly not exist anymore.

| improve this answer | |
1

Well before you can run this command you have to have the privileges to do so as overwriting or modifying files from the command line requires admin rights. Once you got that done, enter the following:

ren (path name) (modified name, no quotation marks)
| improve this answer | |
  • Thanks, but I already have administrative rights. It must just be a glitch with the windows OS. I even tried to rename it using the move command, but nothing works. I can only do it manually. – computer_geek64 Dec 29 '16 at 14:36
0

I fixed this by disabling Quick Access:

See Screenshot:

[]

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.