windows - Copy Files using a batch file -
i need copy set of files mentioned in loop location each file copied directory named after file name.
example : need copy file1.txt path abc def\file1\ ; file2.txt path abc def\file2\
i have been trying use following loop achieve same thing. there seems syntax error doing. because of hurry deliver this, not explore before posting here. searching solutions in parallel. please let me know issue code sample below
for %%file in (de.txt en.txt es.txt fr.txt it.txt ja.txt nl.txt pt.txt zh_cn.txt) set name=%file%.* echo f | xcopy /i /y "c:\textfiles\%name%.txt" d:\textfiles\%name%\languagefile.txt done
try command line
for %f in (de.txt en.txt es.txt fr.txt it.txt ja.txt nl.txt pt.mo zh_cn.txt) echo xcopy "c:\textfiles\%~nf.mo" "d:\textfiles\%~nf\%~nf.mo"
or in batch file
for %%f in (de.txt en.txt es.txt fr.txt it.txt ja.txt nl.txt pt.mo zh_cn.txt) echo xcopy "c:\textfiles\%%~nf.mo% "d:\textfiles\%%~nf\%%~nf.mo"
Comments
Post a Comment