Your Ad 
Here

Wednesday, August 03, 2011

How to use handle -c to a kill process in Windows?

You are getting this error "Cannot delete _vxfiVspCacheFile_1.VSP: There has been a sharing violation. The source or destination file may be in use."This _vxfiVspCacheFile_2.VSP file is in the folder NBU_VSP_Cache.This is happend because of netbackup client is caching opened files.You would soon run out of space in the local drives if there is no cap on it.

To resolve this issue or to delete this file do the following. You might have to download handle.exe or processexplorer.exe will help.

Run handle.exe > output.txt
Find out the process id and the handle number used.

For example in the following output file process id is 8 and the handle to be closed is 218
So run handle -c 218 -p 8

How to run handle -c example:

C:\handle>handle -c 218 -p 8

Handle v3.46
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

218: File (---) C:\NBU_VSP_Cache\_vxfiVspCacheFile_1.VSP
Close handle 218 in System (PID 8)? (y/n) Y

Handle closed.

Now you can delete the file.

Handle output file:

Handle v3.46
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

------------------------------------------------------------------------------
System pid: 8 NT AUTHORITY\SYSTEM
EC: File (RW-) \Device\Mup
15C: File (-W-) C:\pagefile.sys
218: File (---) C:\NBU_VSP_Cache\_vxfiVspCacheFile_1.VSP
250: File (RW-) C:\FTP