Sunday, July 6, 2008

Deleting locked VSP files

Few days ago I found huge VSP files on one of my servers. I found out that those files are temporary files of a symantec backup software. For some reason, from time to time the backup application does not delete it's temporary files.

When I tried to delete the files I couldn't do it - "File is used by another process" or something like that.

DISCLAIMER: Do the following procedure on your own risk. The writer of this blog takes zero (0) responsibility.

To bypass it I used the procedure to delete locked files (without restart):
1. Start Process Explorer by Microsoft/SysInternals(no need for installation, just copy the EXE file to the target machine).
2. Make sure the lower panel is visible: View -> Lower Pane View -> Handles
3. In the process tree select "System"
4. Sort the lower pane by Name, and find the VSP file lock (since the pane is sorted by name, it should be easy to find it by 'e:\WhatEverFileName.vsp')
5. Right-click the record in the lower pane and select "Close Handle".
6. Delete the file.