Replacing old file with new file
Posted on 2004-09-22
Need help writing code.
Each user has a separate folder (user1, user2, user3, etc.)
There are two folders under each user (folder1, folder2)
I want to write a VB program (standard.exe) to replace files in folder1 (file1_user1.txt and file2_user2.txt) and in folder2 (file3_user3.txt) with new files in folder1 (newfile1_user1.txt, newfile2_user2.txt) and folder2 (newfile3_user3.txt)
Path is C:\User1\folder1 and fodler2
C:\User2\folder1 and fodler2
C:\User3\folder1 and fodler2
Which user gets which file replaced depends on "_user" in the filename
For example: John has folders "c:\John\folder1" and ...\folder2
HIs files in folder1 are file1_John.txt, file2_John.txt and file in folder2 is file3_John.txt
These files are replaced with newfile_John.txt
"_" is common to all files
Could you please help with code?