How to batch unlock numerous files within subfolders/folders/directory?????

Discussion in 'macOS' started by Chowmainia, Mar 13, 2008.

  1. Chowmainia macrumors newbie

    Mar 13, 2008
    I have a folder with numerous subfolders, each containing numerous files that i would like to batch unlock (vs tediously unlocking each individual folder).

    failed attempts involve:
    - tried the following terminal action: sudo chflags -R nouchg ( as suggested on this website ( but it did not work.
    I did not try the other suggestions on the website because it started getting really complicated and i was afraid to do something that may cause damage/delete my files
    - tried unlocking the folders and subfolders, however each individual file within the corresponding folder/subfolders remained locked

    Partial but suboptimal solutions tried:
    - i found a partial but not optimal solution to my problem on this site:
    however, the option-command-I will only allow me to unlock files each subfolder at a time (as i need to actually highlight the files themselves).
    is there a way where i could just unlock all the folder/subfolders/files within an entire directory in one fell swoop?

    My system:
    - the new MBP running Mac OS X 10.5.2

    i am a new mac user and i apologize in advance if there is some simple solution to this problem that i have yet failed to discover, but any help would be greatly appreciated

  2. cudapat67 macrumors newbie

    Mar 14, 2008
    there is help

    open all folders and get info uncheck lock and done
  3. mason.kramer macrumors 6502


    Apr 16, 2007
    Watertown, MA
    Time for some serious finder mojo:

    1. Using Finder, the top level folder of those files that you want to unlock. Switch to List View mode (cmd-2).
    2. You should now see a finder pane containing only those files and folders that you want to unlock.
    3. Cmd-a to Select All.
    4. Open all the sub-folders. With all selected, opt-command-right arrow to open up alllll the children.
    5. Cmd-A to select all
    6. Opt-Cmd-I to bring up the single pane inspect
    7. Unlock
    8. See my keyboard navigation guide for more Finder mojo
  4. Chowmainia thread starter macrumors newbie

    Mar 13, 2008
    thank you!!

    thank you mason.kramer!!!
    this is exactly what i was looking for, and it works beautifully!!!
    i had over 24000 files to unlock so of course i had the spinning beach ball for about 15 min in order to complete the unlocking task.

    thanks again
  5. macsrules macrumors regular

    Feb 26, 2008
    This is a good tip, thanks I will use this too

  6. macgaterman macrumors newbie

    May 28, 2008
    Mason is MacGod

    I'm a few months late, but found this thread. I am a Brand New Imac User after being strapped to a PC for the past 18 years. Was trying to clean up files etc. by moving, copying, trashing etc. and ended up with many many gigs of locked files in my trash which wouldn't budge ....... I am not at all familiar with "locked" files. Moral of the story is, Mason's tip rocks ! My wrist was getting very sore going one by one.

    Lots to Mac-Learn for me !
  7. rageth macrumors newbie

    Jun 3, 2008
    Unlock files

    There is a nice little piece of freeware to do this called Locker:

  8. igregurec macrumors newbie

    Jul 25, 2009
    i'm new to mac too and last week i made huge data transfer from my old PC via wlan (i cable access didn't work :confused:)
    now i got many gigs of locked files and subfolder of unfinished projects i would like to work on....
    i've tried to use select all/get info method but it doesn't work on mixed content - most of it is locked and some (don't know which) i've unlocked manually...
    i also tried locker 1.0 which doesn't work on leopard and locker 1.1 which is widget for locking user account :(
    now i really miss explorers "apply to subfolders"...
    could someone, please help?
  9. mason.kramer macrumors 6502


    Apr 16, 2007
    Watertown, MA
    Terminal command.

    Find in /Applications/Utilities/ (or use Spotlight from the upper right:

    Replace /PATH/TO/UNLOCK with the path of the top directory that needs to be unlocked in the line of code below. Then copy the modified command to your terminal and press enter to run it. One thing, if you don't have permission to write the files that you're unlocking, you have to prepend "sudo" to the command and enter an administrator's password.
    export UNLOCK="/PATH/TO/UNLOCK"; find $UNLOCK -type f -exec setfile -a l {} \; find $UNLOCK -type d -exec setfile -a l {} \;

    find is a command that walks through your file hieararchy and applies an expression to each file. setfile is a mac os x application that gets the job done when it comes to files.

    Good luck let me know if that fixed it for you.
  10. wut32 macrumors newbie

    Dec 20, 2009
    Was having the exact same problem...

    Very annoying, after I brought a bunch of files over to my MacBook from a Windows box.

    I Googled around, and stumbled across BatChmod, available here, which made really short work of the issue, and was super easy to run. And I'm definitely not a technical guy either, so I didn't both trying any of the Terminal-related fixes...

    Good luck!


  11. apta macrumors newbie

    Mar 6, 2008
    #11 has the free Locker 1.1 application (not a widget) which is compatible with 10.4+ and I successfully used it under Leopard (10.5) :) :)
  12. realet macrumors newbie

    Apr 22, 2011
    Easy answer

    Open a terminal and navigate to the top of the directory structure for which you would like to change the file lock status (mode).

    Run the following command:

    chmod -R 777 .
  13. pjstew, Feb 7, 2012
    Last edited: Feb 7, 2012

    pjstew macrumors newbie

    Feb 7, 2012
    Basic Solution to batch unlock multiple files

    The first post above by mason.kramer is great if you dont want to type commands. However if you want to unlock many files ie hundreds or thousands, you may find it difficult to achieve.

    In step 5 try by breaking down to say 400 files in a group of folders at a time.

    Do step 6.

    In step 7 if the Locked/Unlocked box shows a minus, click the box several times quickly until it goes blank (no minus & no tick). Once its blank - wait... all locked files selected should unlock.

    Hope this helps. I spent days finding this solution.

    MBP 2011 Lion
  14. blimey27 macrumors newbie

    Mar 10, 2012
    Isn't that a little dangerous? I've tested this with individual files and there is no correlation between the unix-level file permissions and the Mac OS "Locked" flag on each file. Your suggestion would effectively remove all file level security from the affected files, and would NOT actually clear the "Locked" flag.

    I tried Mason's post and it definitely works. However, it takes the computer a while to enumerate files in the Finder when you use the opt-cmd-right arrow, but it's worth the wait. Thousands of files unlocked after a few minutes waiting for Finder to catch up - well worth it!
  15. iperboreano macrumors newbie

    Mar 22, 2012
    I concur with Mason's post - an excellent keyboard tip, it saves a clickfest.

    One snag: finder is claiming there are still some locked files, but I can't see any (nor can finder find the files it claims are there). Hidden files? I can't seem to find a way to unhide files, so I can unlock them and delete them, sigh... :(
  16. GGJstudios macrumors Westmere


    May 16, 2008
    To show hidden files in Finder, enter the following two commands into a Terminal window (press enter after each line):
    defaults write AppleShowAllFiles TRUE
    killall Finder​
    To hide hidden files in Finder, enter the following two commands into a Terminal window (press enter after each line):
    defaults write AppleShowAllFiles FALSE
    killall Finder​
  17. Two macrumors newbie

    May 21, 2010
    Many Thanks

    Just came across a need to do this exact same thing after adding two, 2 TB drives to my Mac Pro. Doing a lot of file management and have a lot of locked files. Many thanks!
  18. slmosher macrumors newbie


    Aug 22, 2015
    Very helpful guide as I had 500 stills to unlock. Thank you.
  19. Tankmaze macrumors 68000


    Mar 7, 2012
    Awesome !!! Thanks so much. This still works great in el capitan.
    I just reinstall el capitan and copy files from time machine and suddenly all my files got locked.
    So yeah this is very much solve it.
  20. meexctain macrumors newbie

    Jan 29, 2016
    --- Post Merged, Jan 29, 2016 ---
    i am using el capital and i went through the steps suggested to unlock batch folders/files by mason but no unlock option was made available in the info pane. what am i missing?
  21. ocabj macrumors 6502a


    Jul 2, 2009
    Uhm, no.

    First off, 777 means read write execute for user owner, group owner, and world. You're never going to do that ever. Even if you think you need to make a file rwx'ed for world, there's a better way to ACL.

    Second, Unix file permissions do not affect the 'Locked' flag of a file in OS X. Flags are part of the BSD and OS X filesystem extension and should be modified via chflags.
  22. GGJstudios macrumors Westmere


    May 16, 2008
    FYI: The post you quoted is the first and only by that poster, who hasn't been in the forum since they posted that almost 5 years ago.
  23. meexctain macrumors newbie

    Jan 29, 2016
    ok but Tankmaze in Nov 2015 said it worked for them with el capitan?
  24. GGJstudios macrumors Westmere


    May 16, 2008
    That's not the post being discussed. ocabj quoted realet, not mason.kramer, which Tankmaze responded to.
  25. meexctain macrumors newbie

    Jan 29, 2016
    oh sorry. how do i unlock batch folders as those instruction from mason.kramer not giving me an unlock option in the info pane

Share This Page

42 March 13, 2008