Unlocking a file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have searched high and low for the answer to my question. I expect that it is right under my nose but it has come time for me to ask anyway. Is there a way to force access to a file on a computer that has been locked by a VB.NET program that is running on another computer

I have a multiuser environment where common data files are stored on a shared server and each program is run separately from each machine. The actual situation is where one system locks a file on the server and for some reason I want to manually release all locks on the files that that system has but from a different computer. I know that I cannot simply use a handle because the second system does not have that handle in memory. I am coding in VB.NET and have checked out the FileStream class as well as others and cannot find anything that will force access into a file

Any help would be greatly appreciated
Thank You
CoolFire
 
It's not easy to do this. You need to muck around with privileges and such.

I found a sample, but it's in C++:

http://www.codeguru.com/Cpp/W-P/files/fileio/article.php/c1287

Maybe you can port it to managed code.

--
Klaus H. Probst, MVP
http://www.vbbox.com/


CoolFire said:
Hello,

I have searched high and low for the answer to my question. I expect that
it is right under my nose but it has come time for me to ask anyway. Is
there a way to force access to a file on a computer that has been locked by
a VB.NET program that is running on another computer?
I have a multiuser environment where common data files are stored on a
shared server and each program is run separately from each machine. The
actual situation is where one system locks a file on the server and for some
reason I want to manually release all locks on the files that that system
has but from a different computer. I know that I cannot simply use a handle
because the second system does not have that handle in memory. I am coding
in VB.NET and have checked out the FileStream class as well as others and
cannot find anything that will force access into a file.
 
Back
Top