# Batch file syntax program



## Frogshiem (Mar 10, 2008)

*Batch file syntax problem*

This is mostly a syntax problem I am use to using shell commands, all I want to do is run a .bat file that will loop through folders and copy everything in them to a corresponding folder else where so I have

some source C:\Data\Math_## and I want to copy every file *.*

to
Y:\Data\Math_##

where ## is a list of random #'s [20 25 26 38 48 96 ...] with no step value.

So far I have.

FOR %%H IN (20 25 26 27 28 29 30 31 33 36 38 39 41 47 48 96 72 140 82 83 86 103 117 120 132 133 138 141 146 190 259 265 280 119 40) DO COPY G:\Child_Data\Math_%%H\*.* Y:\Math_%%H\processed\bv\

in a .bat file

I have looked all over but can't seem to find a faq on how to insert a string into a path, I also tried
G:\Child_Data\Math_ "&&H" \*.*

I'm sure there is a simple solution, but I can't seem to find it anywhere. Any help would be greatly appreciated.


----------

