Is there a way to copy (backup) open or protected files using VB.N

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

Guest

For example the files in a computers windows directory and profile directory
that the application is running on.
 
Not sure what you mean by "protected" ?
It's just no different than usual (ie. you can copy if you have the
appropriate rights, if the file is not exclusively lock etc...).

Have you tried your scenario ? What is the problem you have (error message)
?

Patrice
 
Sorry, yes, I'm referring to the exclusive lock such as the windows registry.

Yes I've tried it with VB6/FSO and with VB.NET. I don't have the code
infront of me to see the error message but it indicates that it can't copy
the file because it's open.

I'm guessing that there is some way to do this because backup software is
able to do it.
 
Not sure but they might save a backup copy that is maintained by windows. As
this version is not live it should work...

Unless writing a backup software, my personal preference is to delegate this
to a backup software rather than to add backup capabilities into a non
backup related application...

Sorry for the poor help...

Patrice

--
 
Greetings Bishop,

Take a look at the System.IO Namespace, in special the File object.
There's a shared method Copy that copies one file to another location.

However it doesn't make bulk copies (ie, copy multiple files). for this
you should start thinking about multi-threads, in order to speed up, or
not (ie, the same way Windows Explorer does).

As for "exclusive locked" files, there's not much to be done. Not even
Backup Applications can open a file that's already open with an
"Excluside Lock". (Please, don't take my word on it, try it :)

Regards,

Paulo
 
Back
Top