Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
copy file to variable folder in bat
Name: nuts Date: July 6, 2006 at 05:07:10 Pacific OS: dos CPU/Ram: 16M Product: PC
Comment:
Anyone can help me.
l want to copy a file to a number of folder.
for example. copy c:\file.txt c:\folder001 copy c:\file.txt c:\folder002 ..... ..... copy c:\file.txt c:\folder998 copy c:\file.txt c:\folder999 how l can make it in the batch for define the variable folder? l try the following but cannot work copy c:\file.txt c:\folder* OR copy c:\file.txt c:\folder???
l use msdos command prompt.l can use FOR LOOP in NT command prompt but it cannot work in msdos because it does not support /L switch.
Does any dos tools can help?
0
Response Number 3
Name: dtech10 Date: July 8, 2006 at 08:03:30 Pacific
Reply:
Hi Nuts Nice Name This will work for MsDos or the Command Prompt The three for loops are on one line. The First copies to folders 000-999 The Second copies to folder 001-999 incase you don't want a folder 000
@echo off rem Copy File.txt to Folder 000-999 for %%a in (0 1 2 3 4 5 6 7 8 9) do for %%b in (0 1 2 3 4 5 6 7 8 9) do for %%c in
Summary: Hello, Miskva. > Guess it *IS* impossible to do > this without 3rd party tools ... It's not impossible. You've already seen a solution without 3rd party - that one from William Allen. However, as I've...
Summary: Hi, You said: "Hi. I have a deep directory tree. for example: c:\0001 c:\0002 c:\0003 c:\0004 Does anyone know how I can copy all of the files that start with T?" Looks like your tree is WIDE, not DE...
Summary: I would like some help with coding a batch file to copy one file to multiple directories. These directories are all sub directories within a main folder...: XML\14_01_2004 XML\15_01_2004 XML\21_01_200...