tags:

views:

66

answers:

4

Hi All, I have a number of files in a give folder A. I want to move these files to folder B one by one. i.e., I am doing processing to every file. so after my own processing completes, I want to move the processed file to a different folder. How can I do that? Please help!

+2  A: 

You probably want the FileSystemObject:

http://articles.techrepublic.com.com/5100-10878_11-1050078.html

RQDQ
http://msdn.microsoft.com/en-us/library/6kxy1a51(VS.85).aspx
Mike Cheel
+1  A: 

Also, obviously you should upgrade and avoid any new vb6 development if possible. If you are .NET enabled however, you can do it much more easily in a .NET library and then expose the .NET component to COM for reference by your VB6 app. The only new requirement would really be that the app requires the .NEt Framework (which is standard now for windows installations). Another benefit of this is that if you later decide to upgrade the app to .NET you already have this functionality done!

Mike Cheel
Totally agreed. I know there is a lot of legacy VB6 still out there (I'm sure that some of mine is still out there somewhere), but we need to let it go!
RQDQ
Indeed there is a lot out there? Every job I have worked at in the past 15 years has had some (except maybe my current job but there is probably some somewhere!).
Mike Cheel
Surely COM interop is a bit excessive here? It's one line in .Net, but it's only two lines in VB6.
MarkJ
I don't know about that. .NET is a lot easier to deal with depending on the topic even when having to roll COM support.
Mike Cheel
+1  A: 

The pure VB6 approach, without using FileSystemObject, is to copy then delete.

FileCopy src, dest
Kill src

Links to manual:

http://msdn.microsoft.com/en-us/library/aa243368(VS.60).aspx

http://msdn.microsoft.com/en-us/library/aa243388(VS.60).aspx

MarkJ
A: 

@MarkJ You could almost say that that's a pure QBASIC approach even. :)

BobRodes