![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 52
Rep Power: 3
![]() |
Copying files
Ok Suppose i have two directories
dim source as string = "C:\MyFiles" dim dest as string = "C:\Mybackup" now if the MyFiles folder contains 5 documents: file1.doc file2.doc file3.doc file4.doc file5.doc I want to click a button, have it check to see if the dest exsists, if it does and there are files in it, get those files and copy them to the backup folder. So far i have: dim source as string = "C:\MyFiles"
dim dest as string = "C:\Mybackup"
if directory.exsists(source) then
dim sFiles() as string
sFiles = Directory.GetFiles(source, "*.doc", SearchOption.TopDirectoryOnly)
'Stuck here after getting the files
'array copy method of some sort? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
xcopy C:\MyFiles C:\MyBackup /E ..I dont know VB sorry, just thought I'd show you a quick and easy way.
__________________
Pain is just weakness leaving the body.
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
MSDN has a example look under CopyFile method
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix commands compatible with Windows? | titaniumdecoy | Bash / Shell Scripting | 7 | Oct 5th, 2006 7:25 AM |
| Command Prompt | SkyPioneer | Coder's Corner Lounge | 5 | May 3rd, 2006 10:07 PM |
| copying files first before deleting them | harjit | Visual Basic | 1 | May 15th, 2005 7:05 AM |
| Checking source codes of image, audio and video files | on_auc | C++ | 3 | Feb 21st, 2005 8:36 PM |
| shutil.copy corrupting files? | TimL | Python | 0 | Feb 20th, 2005 3:32 PM |