How to copy directories using a wildcard

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
 
P

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top