Om du har dina dokument p? en n?tverksmapp och vill l?gga till den i bilblioteket Dokument, och k?r windows 7, och inte vill g?ra den tillg?nglig offline. D? sitter du illa till, det g?r inte.

Om du v?ljer att g?ra den tillg?nglig offline som ?r enda s?ttet, d? f?r fyller du disken med inneh?llet fr?n din n?tverksmapp. Det ?r ingen h?jdare om du har en NAS med 2TB filer, samtidigt som du har 1TB disk p? din dator 🙂

H?r http://i-link.de/IncludeAnyInLibrary/ hittade jag ett program som hj?lper dig att l?gga till en n?tverks share utan att g?ra den tillg?nglig offline!

H?r ?r filen IncludeAnyInLibrary som jag laddat ner, utifall orginalsidan f?rsvinner.

S? h?r skriver han p? sin sida:

 

English:

Include any folder to Windows 7 Libraries.

Additional to the mentioned ways of
a) ”Offline Files” and
b) creating symbolic links
there seems to be another way of adding folders to the libraries by editing the XML files directly which contain the library information.

These files are usually stored in %AppData%\Microsoft\Windows\Libraries\ and are called <Libraryname>.library-ms

Since solution a) isn’t an option due to disk space and somehow I don’t like option b) as well I started to code a little commandline program that edits the *.library-ms files for me.

Programm download: IncludeAnyInLibrary.zip
Source download (Visual Studio Express 2010): IncludeAnyInLibrary.Source.zip

 

Usage:

simpliest:
IncludeAnyInLibrary.exe -add -library Documents -folder \\server\share\folder
Adds the network folder \\Server\share\folder to the Documents library.

IncludeAnyInLibrary.exe -remove -library Documents -folder \\Server\Share\folder
removes a folder from a library

more parameters:
-quiet: Needs to be the first parameter and surpresses all error messages.
-position 2: Instead of adding the new folder at the buttom of the list it inserts in after the existing second entry.
issupported: adds a network share so that Windows Search uses the server based index.

Attention: At the moment the tool is very simplistic and I can’t guarantee that it always works 100% correctly. For me – Windows 7 Pro x64 with all updates installed as of 09. June 2010 – it seems to work fine so far.

New (17.Juni.2010): Folders are checked if they exist, if not or if you dont have access they are not added.

Additionally you can now add or remove the Windows knowfolders e.g. knownfolder:{FDD39AD0-238F-46AF-ADB4-6C85480369C7}=My Documents, See details below). This was important to me to get rid of the local Public folders from each library at first logon – who needs this in a network?
Known folders are not checked for existance, anything where the -folder paramerter starts with knownfolder: is added.

I dont know yet but I assue that search in Windows 7 may not work well or even not work at all since the folders are probably not indexed.

A big help in understanding the libraries was this site: http://zornsoftware.talsit.info/?p=3, the tool offered there is much more advanced than mine but it seems less usable for batch files.

 

 

Details to the knownfolders (This seems to match in an English Windows 7 installation, not tested on anything else yet)

My Music:
knownfolder:{4BD8D571-6D19-48D3-BE97-422220080E43}
Public Music:
knownfolder:{3214FAB5-9757-4298-BB61-92A9DEAA44FF}

My Documents:
knownfolder:{FDD39AD0-238F-46AF-ADB4-6C85480369C7}
Public Documents:
knownfolder:{ED4824AF-DCE4-45A8-81E2-FC7965083634}

My Videos:
knownfolder:{18989B1D-99B5-455B-841C-AB7C74E4DDFC}
Public Videos
knownfolder:{2400183A-6185-49FB-A2D8-4A392A602BA3}

My Pictures:
knownfolder:{33E28130-4E1E-4676-835A-98395C3BC3BB}
Public Pictures:
knownfolder:{B6EBFB86-6907-413C-9AF7-4FC2ABF07CC5}