bat help

  • Thread starter Thread starter Howard
  • Start date Start date
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
 
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
 
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
 
Back
Top