How to copy directories using a wildcard

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

I am trying to copy multiple directories into one
directory using a script or batch file. Specifically, I
would like to copy all directories starting with certain
letter (e.g. b* for directories starting with "b") to
another directory. The xcopy command does not seem to
support this: at least, I can't get it to take a wildcard
as part of a directory name. Does anyone out there have
any ideas about how to script this?

Thank You,

Patrick
 
I solved my own problem. Imagine that : )
This script works in windows 2000 when saved with the .vbs
extension:

Const OverWriteFiles = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder "C:\source\b*" , "C:\destination\b" ,
OverWriteFiles
 
Back
Top