MacOS – Scripting the unhiding of Library folders on Time Machine disks

macostime-machine

Here's the context: I have about 400 students with Time Machine backups from Lion computers. We wiped and re-imaged their laptops with new software AND with Mountain Lion. We just discovered that you can no longer use Time Machine to "Browse other Backup Disks" in Mountain Lion. (The option is there, but the functionality is broken.) The students will have to navigate in Finder to their most recent backup and manually drag the files to their new computer. However, the Library is hidden on the disk, and they can't access it without unhiding it. I know how to unhide the folder using this method in Terminal:

cd ../../Volumes/WhateverTheyNamedTheirBackupDrive/Backups.backupdb/Student's MacBook Air/2012-07-30-192502/Macintosh HD/Users/StudentsUserName
ls
chflags nohidden Library

Does anyone have any idea how I could script something that unhides the mounted backup folders' libraries? I'm struggling with the extreme variability of student backup disk names and folder names within a Time Machine backup. (And I can't exactly expect 400 kids to get it right in terminal.)

Best Answer

Could you use something like this?

sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass chflags nohidden /Volumes/*/Backups.backupdb/*/*/*/Users/*/Library/

bypass was in /System/Library/Extensions/TMSafetyNet.kext/Contents/MacOS/bypass on Lion.