Thursday 12 April 2012

AppV Unload All Apps

I have been having an issue where AppV is writing absolutely loads of temporary files in C:\ProgramData\Microsoft\Application Virtualization Client\SoftGrid Client\AppFS Storage. In fact I had >6000 temporary files for each every application on my RDSH servers - two files are created for each and every user who loads the application, each and every time they logon to the server (as I use mandatory profiles). This soon starts to chew up even large system drives. None of the normal methods of clearing the AppV cache empty this area. In fact the only command I found that did was SFTMIME /UNLOAD. Granted you could write a script to manually delete these files, but I wanted to use a supported method.

Using SFTMIME to unload all the apps turned out to be easier said than done due to the number of parameters that need to be sent and all the annoying spaces in file paths and application names. Anyway I wrote a really convuluted process which works great and thought I would share.

http://dl.dropbox.com/u/13464150/UnloadAppVCache.zip