Hi,
Just wondering how to copy directories where the name = ABC* and the files contained therein. I can do a dir /d ABC*, but I can't do a copy or xcopy ABC*\*.*
Any suggestions?
Page 1 of 1
Simple Batch file to copy specific directories
#2
Posted 01 October 2009 - 07:47 PM
for /f %%_ in ('dir /ad /b from\ab*') do xcopy from\%%_\*.* to\%%_\ /s /e
#3
Posted 24 October 2009 - 11:15 AM
Hi,
Thanks IcemanND for the help with the following command. I changed the xcopy to dir for a test before the copy, and it works, but why would it miss the folders with 'spaces' in the name? What's needed to so that it sees all the folders including those with space in the name?
Thanks IcemanND for the help with the following command. I changed the xcopy to dir for a test before the copy, and it works, but why would it miss the folders with 'spaces' in the name? What's needed to so that it sees all the folders including those with space in the name?
for /f %_ in ('dir /ad /b c:\dir\*') do dir "c:\dir\%_\*.*"
#4
Posted 24 October 2009 - 06:42 PM
Add the tokens option to the for command.
for /f "tokems=*" %_ in ('dir /ad /b c:\dir\*') do dir "c:\dir\%_\*.*"
for /f "tokems=*" %_ in ('dir /ad /b c:\dir\*') do dir "c:\dir\%_\*.*"
#5
Posted 25 October 2009 - 03:29 AM
- ← Help with VB Script
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- PowerShell Cmdlet in Visual Basic →
Share this topic:
Page 1 of 1



Help

Back to top










