PDA

View Full Version : How to batch unlock numerous files within subfolders/folders/directory?????




Chowmainia
Mar 13, 2008, 11:47 PM
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



cudapat67
Mar 14, 2008, 05:59 AM
open all folders and get info uncheck lock and done

mason.kramer
Mar 14, 2008, 08:02 AM
Problem:
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

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

Chowmainia
Mar 14, 2008, 11:56 PM
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

macsrules
Mar 15, 2008, 11:21 PM
This is a good tip, thanks I will use this too


MacsRules

macgaterman
May 28, 2008, 10:34 PM
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 !

rageth
Jun 3, 2008, 09:57 PM
There is a nice little piece of freeware to do this called Locker:
http://www.versiontracker.com/dyn/moreinfo/macosx/20751&vid=114708


...
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

igregurec
Jul 25, 2009, 11:58 AM
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!

mason.kramer
Aug 5, 2009, 06:25 AM
Terminal command.

Find Terminal.app in /Applications/Utilities/Terminal.app (or use Spotlight from the upper right:
http://www.masonkramer.net/~masonkramer/screenshots/27eaa696119a50ff02735b619638166f.jpg)

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.

wut32
Dec 20, 2009, 12:21 PM
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 (http://www.macchampion.com/arbysoft/BatchMod/Welcome.html), 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.

apta
Apr 12, 2011, 07:57 PM
i also tried locker 1.0 which doesn't work on leopard and locker 1.1 which is widget for locking user account :(

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) :) :)

realet
Apr 22, 2011, 07:00 AM
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 .

pjstew
Feb 7, 2012, 05:44 PM
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

blimey27
Mar 10, 2012, 05:51 PM
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 .

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!

iperboreano
Mar 22, 2012, 03:44 PM
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!

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... :(

GGJstudios
Mar 22, 2012, 09:31 PM
II can't seem to find a way to unhide files, so I can unlock them and delete them, sigh... :(
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