471,338 Members | 1,024 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

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

For example the files in a computers windows directory and profile directory
that the application is running on.
Jul 21 '05 #1
4 2777
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

--

"Bishop" <Bi****@discussions.microsoft.com> a écrit dans le message de
news:BA**********************************@microsof t.com...
For example the files in a computers windows directory and profile directory that the application is running on.

Jul 21 '05 #2
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.

"Patrice" wrote:
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

--

"Bishop" <Bi****@discussions.microsoft.com> a écrit dans le message de
news:BA**********************************@microsof t.com...
For example the files in a computers windows directory and profile

directory
that the application is running on.


Jul 21 '05 #3
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

--

"Bishop" <Bi****@discussions.microsoft.com> a écrit dans le message de
news:EE**********************************@microsof t.com...
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.

"Patrice" wrote:
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

--

"Bishop" <Bi****@discussions.microsoft.com> a écrit dans le message de
news:BA**********************************@microsof t.com...
For example the files in a computers windows directory and profile

directory
that the application is running on.


Jul 21 '05 #4
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

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by durumdara | last post: by
6 posts views Thread by Charles Morrall | last post: by
5 posts views Thread by kebuchan | last post: by
5 posts views Thread by hula | last post: by
6 posts views Thread by Samuel | last post: by
3 posts views Thread by rubbishemail | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.