Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Access Denied when Renaming File/Folder  (Read 14908 times)

0 Members and 1 Guest are viewing this topic.

Michael

    Topic Starter


    Adviser
  • Thanked: 1
    • Experience: Experienced
    • OS: Windows 7
    Access Denied when Renaming File/Folder
    « on: December 25, 2011, 01:34:17 PM »
    Sometimes when I try to rename a folder, I got an error of:

    Access is denied.
    Make sure the disk is not full or write-protected and that the file is not currently in use.

    While I'm sure the files in the folder is not in use by any program or write protected, it's usually solved by restarting Windows.

    Is there a way we can check what program/process is actually locking access to the folder renaming?

    shimal



      Rookie
      • Experience: Familiar
      • OS: Windows 7
      Re: Access Denied when Renaming File/Folder
      « Reply #1 on: December 25, 2011, 02:55:14 PM »
      easy way would be AVG PC Tuneup 2011
      Advanced tools / Locked files
      All you need to do is type the name of the file that is locked and it will find it for you.
      You could also unlock it, but that way all the related files that are running would be terminated/closed.
      Also you could see all the related files in the "Locked by" tab

      EDIT: This was not what you asked :/
      Hard way is "Task manager", you would need to know what program that file/folder is related to and close that file/folder.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Access Denied when Renaming File/Folder
      « Reply #2 on: December 25, 2011, 03:12:44 PM »
      Sometimes when I try to rename a folder, I got an error of:

      Access is denied.
      Make sure the disk is not full or write-protected and that the file is not currently in use.

      While I'm sure the files in the folder is not in use by any program or write protected, it's usually solved by restarting Windows.

      Is there a way we can check what program/process is actually locking access to the folder renaming?

      you can use the handle tool from sysinternals, something like this:

      Code: [Select]
      handle | find /i "C:\path\to\folder"
      which ought to give you the process(es) with files in that folder open.

      Another option is to use the SysInternals Process Explorer tool for the same function. The difference is Process Explorer is a GUI app so might be a better solution depending on your skill level.

      With process Explorer, first either run it as an admin, or after starting it you can choose File->Show details for All Processes, which will also run it as an administrator. Now you can use the Find->Find Handle or DLL option. Enter the Folder name  in the Handle or DLL substring field, and choose search. You'll get a listing of all the processes that have open handles within that folder.

      Also I'd like to point out that AV applications are notorious for this type of thing.
      I was trying to dereference Null Pointers before it was cool.

      Michael

        Topic Starter


        Adviser
      • Thanked: 1
        • Experience: Experienced
        • OS: Windows 7
        Re: Access Denied when Renaming File/Folder
        « Reply #3 on: December 26, 2011, 02:18:52 AM »
        Thanks Shimal and BC Programmer.

        I'll try it next time.

        Michael

          Topic Starter


          Adviser
        • Thanked: 1
          • Experience: Experienced
          • OS: Windows 7
          Re: Access Denied when Renaming File/Folder
          « Reply #4 on: December 29, 2011, 01:58:59 AM »
          Hi BC_Programmer,

          So now I got this folder name New Folder in one of the directory, which I edited the photos inside with Photoshop.
          After I'm done editing and copy the photo elsewhere, leaving it an empty folder, I cannot delete it.

          I've closed Photoshop.
          When I run Process Explorer and search for the folder, the only process accessing it is explorer.exe

          I close the windows explorer and reopen, no luck.

          Daisymae70



            Beginner

            Thanked: 5
            • IowaMrs70 Blog
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 7
          Re: Access Denied when Renaming File/Folder
          « Reply #5 on: December 29, 2011, 02:14:52 PM »
          Not sure if this would help, but I have seen it recommended on this forum. Never had a chance to use it as yet.



          http://emcosoftware.com/move-on-boot
          The Truth is the Truth whether you believe it or not.

          Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.

          You can lead a horse to water but you can't make him drink.

          Salmon Trout

          • Guest
          Re: Access Denied when Renaming File/Folder
          « Reply #6 on: December 29, 2011, 02:18:07 PM »
          rem move up one level

          Does that line move up one folder?


          Michael

            Topic Starter


            Adviser
          • Thanked: 1
            • Experience: Experienced
            • OS: Windows 7
            Re: Access Denied when Renaming File/Folder
            « Reply #7 on: January 06, 2012, 12:05:42 AM »
            http://emcosoftware.com/move-on-boot

            Hi IowaMrs, thanks for the suggestion.
            I believe that application will do the trick, but it's just slightly more convenient than I rename/delete the folder manually, since both methods require reboot.