bat help

H

Howard

I need to write a script that copy any folder that begins with the letter a
from c:\temp to d:\temp2

please help
thanks
howard
 
B

billious

Howard said:
I need to write a script that copy any folder that begins with the letter a
from c:\temp to d:\temp2

please help
thanks
howard

[1]@echo off
[2]md d:\temp2 >nul 2>nul
[3]for /f %%i in ( ' dir /a:d /b c:\temp\a* ' ) do md d:\temp2\"%%i"&cd
"%%i"&xcopy /s/e . d:\temp2\"%%i">nul&cd ..

There are 3 lines to the script. Each has been prefixed by [number] for
identification. The lines may be displayed wrapped. You would need to rejoin
them to re-create a working script.

The spaces around the single quotes in [3] are for clarity and are not
required. The single-quotes ARE required.

NT+ batch techniques at alt.msdos.batch.nt
 
H

Howard

Thanks
billious said:
Howard said:
I need to write a script that copy any folder that begins with the letter
a from c:\temp to d:\temp2

please help
thanks
howard

[1]@echo off
[2]md d:\temp2 >nul 2>nul
[3]for /f %%i in ( ' dir /a:d /b c:\temp\a* ' ) do md d:\temp2\"%%i"&cd
"%%i"&xcopy /s/e . d:\temp2\"%%i">nul&cd ..

There are 3 lines to the script. Each has been prefixed by [number] for
identification. The lines may be displayed wrapped. You would need to
rejoin them to re-create a working script.

The spaces around the single quotes in [3] are for clarity and are not
required. The single-quotes ARE required.

NT+ batch techniques at alt.msdos.batch.nt
 

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