By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,230 Members | 2,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,230 IT Pros & Developers. It's quick & easy.

Unlocking a file

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/file...icle.php/c1287

Maybe you can port it to managed code.

--
Klaus H. Probst, MVP
http://www.vbbox.com/
"CoolFire" <an*******@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
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

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.