Link to home
Start Free TrialLog in
Avatar of Borsec
BorsecFlag for Romania

asked on

Get files locked by a process and unlock a speciffic file

Hi everybody!

I have a to find the list of files locked by a process. The list will be logged for analyse purposes. If the list contains a speciffic file the lock must be released in order to move the file. The locking process must not be killed.

TNX
SOLUTION
Avatar of Borsec
Borsec
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi
if you want to move the file?, you can move it directly.
file.move(source, destination);

you don't have to unlock to move the file.
System.IO.File.Move('running1.exe', 'running2.exe');
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, you didn't ask about deleting a locked file, its seems that your doing not right.
anyway carry on.
Avatar of Borsec

ASKER

No other exper came with a reasonable solution and my solution did the trick.