-
January 26th, 2006, 04:26 PM
#1
VB6 - copying multiple files at once
Hello All,
I've been playing with VB6 a little and was wondering how someone could code this.
I'm trying to copy several files with the same extention (ex: *.txt) from several folders to one.
the command FileCopy only allows for one file at a time (that I know of)
I tried using the shell "xcopy" command but only get the files from the directory that the VB program runs from.
I wrote:
private sub command1_click()
shell "xcopy *.txt /s c:\backup"
end sub
but I don't get the same result as when I'm in DOS.
Any suggestions, or corrections?
-
January 26th, 2006, 05:34 PM
#2
You probably need to set your current working directory to the appropriate directory for the xcopy.
"When I get a little money I buy books; and if any is left I buy food and clothes." - Erasmus
"There is no programming language, no matter how structured, that will prevent programmers from writing bad programs." - L. Flon
"Mischief my ass, you are an unethical moron." - chsh
Blog of X
-
January 26th, 2006, 08:54 PM
#3
Re: VB6 - copying multiple files at once
perhaps
Code:
private sub command1_click()
shell "xcopy c:\*.txt /s c:\backup"
end sub
will work?
Its not vb6 problem; is a working directory problem (as Juridian stated). If you dont specify source path, windows will assume current (or working directory).
Meu sÃtio
FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
If I die before I sleep, I pray the Lord my soul to encrypt. If I die before I wake, I pray the Lord my soul to brake.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|