Firstly: happy new year! Secondly: yes I know this is about Windows 7 but there are still plenty of Windows 7 desktops out there! I haven’t tested this on Windows 8.x yet, so if you do please let me know how it goes 🙂
Ever since Windows 7 was first released in Beta, one of the common gripes amongst the techies doing deployment projects was how to automate through scripting, and therefore MDT, the creation/modification of the Windows 7 Libraries. I’ve seen a few different solutions but they were all rather ugly as they involved hacking the registry using a process discovered (no idea by who) through trial-and-error. I never liked these hacks so would always steer customers well away from them (as well as towing the Microsoft line of “this is an unsupported method” etc.).
Well, fret no more, because it seems that Microsoft finally got round to creating such a tool – and even published the source code for it! You can find the MSDN documentation for SHLIB.exe here: http://msdn.microsoft.com/library/dd940379
Here are the usage instructions for it: shlib.exe SUBCOMMAND
create – Creates a library at the specified path.
info – Prints info about the given library.
enum – Enumerates the folders in the library.
setattrib – Modifies the attributes of the library.
add – Adds the specified folder to the specified library.
remove – Removes the specified folder from the library.
setsaveloc – Sets the default save location of the library.
resolve – Resolves the specified folder in the library.
resolveall – Resolves all locations in the library in bulk.
manage – Displays the Manage Library Dialog for the library.
By the way, Raymond Chen also blogged about it here: http://blogs.msdn.com/b/oldnewthing/archive/2012/08/28/10343980.aspx