Does anyone know how to "clear local cache" with a .bat file?
Does anyone know how to "clear local cache" with a .bat file?
Hello,
If you are very specific to run a batch file (*.bat) to execute "Clear Local Cache", I think it can only be possible to build an executable first with EPDM API and later built a batch (*.bat) file to do the same. I know this is not the best way. Below is the work around if you would like to try.
Did u ever tested "Dispatch" utility provided by EPDM? If you know how to set a dispatch action "delete", the action "delete" in dispatch is same as "clear local cache" in user interface. But remember you should not select the check-box option linked to "delete" action in dispatch functionality. You can find my dispatch screenshot with which I hope you can accomplish to do what you are looking for. Hope this information is useful..
Once the Dispatch action is set, you can have dispatch executing this action in "Menu click" or during "state change", during "check-in\out" and so on.
Thanks to Sylvain Trudel, Technical Sales Manager, EPDM who had provided me this tip 2 years before.
I'd avoid deleting local files using a .bat file - while it would be ok if all files are read only and "safe" to delete - imagine you have an assembly checked out but not its parts. So parts would still be read-only. The .bat file would delete the parts and you probably would get resolve errors when opening and working on the assembly.
The Enterprise API has methods for clearing local cache "safely". You could create an exe that runs the command - or automate it to run recurringly by for example using Windows scheduler.
-Tor iveroth, SolidWorks support.
Hi Spencer.
Not sure if you found an answer in the meantime, but you can just right click on the EPDM blueberry folder (the topmost level folder) and select "Clear local cache)
Regards
Using scripting:
Dim vault Dim clearCache Dim folder Set vault = CreateObject("ConisioLib.EdmVault") Call vault.LoginAuto("YourVault", 0) If vault.IsLoggedIn Then Set folder = vault.GetFolderFromPath(vault.RootFolderPath + "\Folder 1") Set clearCache = vault.CreateUtility(19) '19 being the enum for EdmUtil_ClearLocalCache Call clearCache.AddFolder(folder.ID, true) ' true for recursive Call clearCache.CommitClear(nothing) End If
It would be a little tricky because you would have to look at the file attributes -you would only want to delete the read-only files and keep the ones with read access.
Consider using Scripting instead so you can use EPDM's API?