WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Files and Directories

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Make Available Offline

 Keywords: Make Available Offline Folder Directory Verbs DoIt Shell.Application

#DefineFunction AlwaysAvailableOffline(path,folder)
   ;***************************************************************************
   ;**          Make Available Offline
   ;**   To be able to work with a file/folder offline,
   ;**   you first need to make it available offline.
   ;**
   ;** path: name of the directory excluding the foldername
   ;** folder: the name of the folder to make Always available offline.
   ;**
   ;** DETAILS: Working with network files when you are offline
   ;** You can access files stored in a network folder even when that network folder is unavailable. You can do this by making the folder available offline. When you make a network folder available offline,
   ;** Windows copies all the files from that folder to your computer. These copies of network files that are stored on your computer are called offline files. Windows automatically uses your offline files
   ;** any time the network files are not available. This way you can keep working on the network files without interruption, even if you lose your connection to the network folder. When you connect to the
   ;** network folder again, Windows will automatically sync the files on your computer with the files in the network folder.
   ;**
   ;** To enable offline files
   ;** Enable offline files if you want to work with files that are in a network folder. A copy of the file on your hard drive will be synchronized with the network copy as soon as you are back at work or you regain your network connection.
   ;** 1. Open Offline Files by clicking the Start button Picture of the Start button, clicking Control Panel, clicking Network and Internet, and then clicking Offline Files.
   ;** 2. Click the General tab, and then click Enable Offline Files.
   ;**
   ;** Deana Falk 2013.11.6
   ;***************************************************************************
   rslt = 0
   objShell = ObjectCreate('Shell.Application')
   objFolder = objShell.Namespace(path)
   objFolderItem = objFolder.ParseName(folder)
   colVerbs = objFolderItem.Verbs
   ForEach objVerb In colVerbs
    If StrLower(StrReplace(objVerb.name, '&', '')) == 'always available offline'
       objVerb.DoIt
       rslt = 1
    EndIf
   Next
   Return rslt
#EndFunction

SourcePath = '\\server\share'
DirName = 'mystuff'
ret = AlwaysAvailableOffline(SourcePath,DirName)

If ret
    Pause('AlwaysAvailableOffline','This folder is now available offline.')
Else
    Pause('AlwaysAvailableOffline','Failed')
EndIf
Exit

Article ID:   W18364
Filename:   Make Available Offline .txt
File Created: 2013:11:07:13:23:52
Last Updated: 2013:11:07:13:23:52