Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / VB Syntax / April 2009



Tip: Looking for answers? Try searching our database.

Copying Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Mignault - 12 Apr 2009 19:26 GMT
Medic is a folder.

What code would I use to copy folder C:\Program Files\Medic

to:

F:\Program Files

Regards,

Bob Mignault
MikeD - 13 Apr 2009 19:58 GMT
> Medic is a folder.
>
[quoted text clipped - 3 lines]
>
> F:\Program Files

If you want to go with pure VB code, you'd need to use a combination of the
MkDir statement (to create the Medic folder in F:\Program Files), the Dir$()
function (to get all the files in C:\Program Files\Medic), the FileCopy
statement (to copy the files you found using Dir$), the Kill statement (to
delete the files in C:\Program Files\Medic) and the RmDir statement (to
remove the Medic folder in C:\Program Files). If Medic has any subfolders,
you'll need to work with those subfolders "on their own". If Medic has any
subfolders, and if those have any subfolders (etc., etc.), this can start to
get pretty messy.

There are also numerous Win32API functions you could use that would make
this much easier.  For example, SHFileOperation, which is essentially the
exact same function Windows itself uses when copying, moving, deleting files
in Windows (for example, in an Explorer window). If you search the
newsgroups at www.google.com on that function name, you should finds tons of
example code for it.

Signature

Mike

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.