![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Copy open files? Is there a way (using VB.Net or C#) to copy open or locked files? Thanks! jim |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Copy open files? On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: Quote: > Is there a way (using VB.Net or C#) to copy open or locked files? > > Thanks! > > jim http://www.java2s.com/Code/VB/File-D...nlockafile.htm |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Copy open files? On Apr 8, 11:20*am, "jim" <j...@xxxxxx> wrote: Quote: > Is there a way (using VB.Net or C#) to copy open or locked files? > > Thanks! > > jim No, if the file is locked by another process you cannot access it |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Copy open files? On Apr 8, 12:45*pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: Quote: > On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: > Quote: > > Is there a way (using VB.Net or C#) to copy open or locked files? Quote: > > Thanks! Quote: > > jim > Look at this:http://www.java2s.com/Code/VB/File-D...nlockafile.htm locked file (most probably locked in another process) |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Copy open files? AFAIK no (except perhaps using a very low level API (I'm thinking about backup specific APIs)). You may want to elaborate on what you are trying to do but it looks like something unusual... "jim" <jim@xxxxxx> a écrit dans le message de news: J2MKj.3941$DY1.2394@xxxxxx Quote: > Is there a way (using VB.Net or C#) to copy open or locked files? > > Thanks! > > jim > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Copy open files? On Apr 8, 8:43 pm, "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mac...@xxxxxx> wrote: Quote: > On Apr 8, 12:45 pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: > Quote: > > On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: Quote: Quote: > > > Is there a way (using VB.Net or C#) to copy open or locked files? Quote: Quote: > > > Thanks! Quote: Quote: > > > jim Quote: > > Look at this:http://www.java2s.com/Code/VB/File-D...nlockafile.htm > That shows how to lock/unlock a file, not how to read an already > locked file (most probably locked in another process) the code then he could copy it. (PS: The thread is a cross-post) |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Copy open files? "kimiraikkonen" <kimiraikkonen85@xxxxxx> wrote in message news:a64fa0bc-2ba5-4794-9a3d-727a6e82e61a@xxxxxx Quote: > On Apr 8, 8:43 pm, "Ignacio Machin ( .NET/ C# MVP )" > <ignacio.mac...@xxxxxx> wrote: Quote: >> On Apr 8, 12:45 pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: >> Quote: >> > On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: Quote: >> > > Is there a way (using VB.Net or C#) to copy open or locked files? Quote: >> > > Thanks! Quote: >> > > jim Quote: >> That shows how to lock/unlock a file, not how to read an already >> locked file (most probably locked in another process) > Yes, i just wanted to point out that he could unlock the file using > the code then he could copy it. > means opened exclusively, that is, non shared. You can only use the "shadow copy services " to copy such file(s). The shadow copy services API's aren't covered by the framework however. Willy. |
My System Specs![]() |
| | #8 (permalink) |
| | RE: Copy open files? The Volume Shadow Copy service supports backing up locked files. There is an API for this, which I have used via a batch file with script to backup the Registry, but that's about as much as I can tell you. -- Peter Site: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com Short Urls & more: http://ittyurl.net "jim" wrote: Quote: > Is there a way (using VB.Net or C#) to copy open or locked files? > > Thanks! > > jim > > > |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Copy open files? On Apr 8, 10:08 pm, "Willy Denoyette [MVP]" <willy.denoye...@xxxxxx> wrote: Quote: > "kimiraikkonen" <kimiraikkone...@xxxxxx> wrote in message > > news:a64fa0bc-2ba5-4794-9a3d-727a6e82e61a@xxxxxx > > > Quote: > > On Apr 8, 8:43 pm, "Ignacio Machin ( .NET/ C# MVP )" > > <ignacio.mac...@xxxxxx> wrote: Quote: > >> On Apr 8, 12:45 pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: Quote: Quote: > >> > On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: Quote: Quote: > >> > > Is there a way (using VB.Net or C#) to copy open or locked files? Quote: Quote: > >> > > Thanks! Quote: Quote: > >> > > jim Quote: Quote: Quote: Quote: > >> That shows how to lock/unlock a file, not how to read an already > >> locked file (most probably locked in another process) Quote: > > Yes, i just wanted to point out that he could unlock the file using > > the code then he could copy it. > No you can't "unlock" a file "locked" by another process. Where "locked" > means opened exclusively, that is, non shared. > You can only use the "shadow copy services " to copy such file(s). The > shadow copy services API's aren't covered by the framework however. > > Willy. The link i've posted claims that it locks and unlocks and updates the same file under same application (under developer's application, even can't get it worked such article). However there are some 3rd party applications such as "Unlocker" which can unlock files locked by "any" process . So that's another point of interest. Plus it would be good to get a complete working code that locks and unlocks and stores same file using FileStream class. The sample link i've posted is not a well-explained one. Thanks |
My System Specs![]() |
| | #10 (permalink) |
| | Re: Copy open files? On Apr 8, 2:30*pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: Quote: > On Apr 8, 8:43 pm, "Ignacio Machin ( .NET/ C# MVP )" > > <ignacio.mac...@xxxxxx> wrote: Quote: > > On Apr 8, 12:45 pm, kimiraikkonen <kimiraikkone...@xxxxxx> wrote: Quote: Quote: > > > On Apr 8, 6:20 pm, "jim" <j...@xxxxxx> wrote: Quote: Quote: > > > > Is there a way (using VB.Net or C#) to copy open or locked files? Quote: Quote: > > > > Thanks! Quote: Quote: > > > > jim Quote: Quote: > > > Look at this:http://www.java2s.com/Code/VB/File-D...nlockafile.htm Quote: > > That shows how to lock/unlock a file, not how to read an already > > locked file (most probably locked in another process) > Yes, i just wanted to point out that he could unlock the file using > the code then he could copy it. > > (PS: The thread is a *cross-post) You can only unlock a file that you previously locked . Not only that, but you must also use the same reference. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Urgent!! Can't copy/move or open files in Maxtor external drive. | Vista file management | |||
| copy-item changing files attributes on network copy failures | PowerShell | |||
| vista can't copy large files? another XP file-copy bug? | Vista General | |||
| Can't copy media files into media library if WMP11 is open. | Vista music pictures video | |||
| Can't copy media files into monitored folders while WMP11 is open. | Vista networking & sharing | |||