Question : Need example code to programmatically pin a folder to make it "Always Available Offline"

We have an environment where users have the ability to right click a particular folder (their home drive) to make it "Always Availalble Offline", but we'd like to do this programatically via something like a login script.  There is a WMI Provider called Win32_OfflineFilesCache which seems to suggest it's what we're looking for but MSDN does not give us example code.  I've found some good and complex example code from "The Filing Cabinet" (http://blogs.technet.com/filecab/archive/2007/05/01/synchronizing-offline-files-from-the-command-line.aspx) about synchronizing folders which have already been made availalbe offline, but I need some sample code to make a folder availalbe offline.

Does somebody have this working via VBScript and can share some of their code please?

With thanks

Answer : Need example code to programmatically pin a folder to make it "Always Available Offline"

So hopefully that script will mark a folder for synchronisation, but use the earlier script from the link to actually make the synchronisation happen for all files in the Offline Cache.

Regards,

Rob.
Random Solutions  
 
programming4us programming4us