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

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

  1. Chowmainia macrumors newbie

    Joined:
    Mar 13, 2008
    #1
    Problem:
    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 (http://docs.info.apple.com/article.html?artnum=106237) 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:
    http://forums.macrumors.com/showthread.php?t=366864&highlight=unlock+files
    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

    thanks
     
  2. cudapat67 macrumors newbie

    Joined:
    Mar 14, 2008
    #2
    there is help

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

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #3
    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
    http://forums.macrumors.com/showthread.php?t=452390
     
  4. Chowmainia thread starter macrumors newbie

    Joined:
    Mar 13, 2008
    #4
    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

    Joined:
    Feb 26, 2008
    #5
    This is a good tip, thanks I will use this too


    MacsRules
     
  6. macgaterman macrumors newbie

    Joined:
    May 28, 2008
    #6
    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

    Joined:
    Jun 3, 2008
    #7
    Unlock files

    There is a nice little piece of freeware to do this called Locker:
    http://www.versiontracker.com/dyn/moreinfo/macosx/20751&vid=114708

     
  8. igregurec macrumors newbie

    Joined:
    Jul 25, 2009
    Location:
    Croatia
    #8
    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?
    thanks!
     
  9. mason.kramer macrumors 6502

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #9
    Terminal command.

    Find Terminal.app in /Applications/Utilities/Terminal.app (or use Spotlight from the upper right:
    [​IMG])

    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

    Joined:
    Dec 20, 2009
    #10
    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!

    Cheers,

    T.
     
  11. apta macrumors newbie

    Joined:
    Mar 6, 2008
    #11
    http://www.vojousoftware.com/locker/ 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

    Joined:
    Apr 22, 2011
    #12
    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

    Joined:
    Feb 7, 2012
    #13
    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

    Joined:
    Mar 10, 2012
    #14
    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

    Joined:
    Mar 22, 2012
    #15
    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

    GGJstudios

    Joined:
    May 16, 2008
    #16
    To show hidden files in Finder, enter the following two commands into a Terminal window (press enter after each line):
    defaults write com.apple.Finder 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 com.apple.Finder AppleShowAllFiles FALSE
    killall Finder​
     
  17. Two macrumors newbie

    Joined:
    May 21, 2010
    #17
    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

    slmosher

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

    Tankmaze

    Joined:
    Mar 7, 2012
    #19
    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

    Joined:
    Jan 29, 2016
    #20
    --- 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

    ocabj

    Joined:
    Jul 2, 2009
    #21
    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

    GGJstudios

    Joined:
    May 16, 2008
    #22
    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

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

    GGJstudios

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

    Joined:
    Jan 29, 2016
    #25
    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