Unlocking a file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CoolFire

    #1

    Unlocking a file

    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
  • Klaus H. Probst

    #2
    Re: Unlocking a file

    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
    Great prices on a large selection of domains. Find the pefect domain for your new startup.



    "CoolFire" <anonymous@disc ussions.microso ft.com> wrote in message
    news:CFAC6784-014C-4633-8EF6-AC25FF8CAAC6@mi crosoft.com...[color=blue]
    > Hello,
    >
    > I have searched high and low for the answer to my question. I expect that[/color]
    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?[color=blue]
    >
    > I have a multiuser environment where common data files are stored on a[/color]
    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.[color=blue]
    >
    > Any help would be greatly appreciated.
    > Thank You,
    > CoolFire[/color]


    Comment

    Working...