Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
Hi All,
Can File copy be used with the extension *.* in order to copy the contents of folders or does another method need to be used? i.e. will this work? Filecopy "C:\temp1\*.*", "C:temp2\*.*" Ta Andi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
I presume I need to use the filesystemobject.copyfolder method - would this
be fast enough for transfering 1/2gb of files or is there a quicker way? "Andibevan" wrote in message ... Hi All, Can File copy be used with the extension *.* in order to copy the contents of folders or does another method need to be used? i.e. will this work? Filecopy "C:\temp1\*.*", "C:temp2\*.*" Ta Andi |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
As you correctly figured, Filecopy does not work with wildcards. I have not
had any speed issues with FileSystemObject. Alok Joshi "Andibevan" wrote: I presume I need to use the filesystemobject.copyfolder method - would this be fast enough for transfering 1/2gb of files or is there a quicker way? "Andibevan" wrote in message ... Hi All, Can File copy be used with the extension *.* in order to copy the contents of folders or does another method need to be used? i.e. will this work? Filecopy "C:\temp1\*.*", "C:temp2\*.*" Ta Andi |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
Hello again,
Maybe you could make use of the Dir function, which returns the name of the file when it exists or an empty string when not. Especially its use in loops I find very practical (Dir without argument returns the next filename within the given range): PathFrom = "c:\Temp1" PathTo = "c:\Temp2" varTest = Dir(PathFrom) Do Until varTest = "" From = PathFrom + "\" + varTest To = PathTo + "\" + varTest FileCopy From, To varTest = Dir Loop It works fine, but how time consuming it is in your case, I don't know! Maybe this could be of help to you, Greetings, PS: Dir may be used with just a path or with wildcards, e.g. "c:\TestFolder\a*.doc" , so you even could make selections this way. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy (now OK!)
So sorry!
Almost always thoroughly testing, but not this time... so at least two mistakes! Here the correct code PathFrom = "c:\Temp1" ' both paths should exist PathTo = "c:\Temp2" varTest = Dir(PathFrom + "\*.*") ' filename [wildcards allowed] necessary Do Until varTest = "" FileFrom = PathFrom + "\" + varTest FileTo = PathTo + "\" + varTest ' now a better variable name! FileCopy FileFrom, FileTo varTest = Dir Loop Greetings again, Peter |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
You could try:
Shell ("Command.com /c Copy C:\temp1\*.*, C:temp2\*.*") You can check out this link. http://support.microsoft.com/default...b;en-us;213800 HTH "Andibevan" wrote: I presume I need to use the filesystemobject.copyfolder method - would this be fast enough for transfering 1/2gb of files or is there a quicker way? "Andibevan" wrote in message ... Hi All, Can File copy be used with the extension *.* in order to copy the contents of folders or does another method need to be used? i.e. will this work? Filecopy "C:\temp1\*.*", "C:temp2\*.*" Ta Andi |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
Thanks to all for your help on this one.
Regards Andi "Andibevan" wrote in message ... I presume I need to use the filesystemobject.copyfolder method - would this be fast enough for transfering 1/2gb of files or is there a quicker way? "Andibevan" wrote in message ... Hi All, Can File copy be used with the extension *.* in order to copy the contents of folders or does another method need to be used? i.e. will this work? Filecopy "C:\temp1\*.*", "C:temp2\*.*" Ta Andi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
filecopy Question | Excel Discussion (Misc queries) | |||
FileCopy problem | Excel Programming | |||
FileCopy and read-only | Excel Programming | |||
FileCopy | Excel Programming | |||
FileCopy | Excel Programming |