[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ProgSoc] DOS Batch file
> What I want is for the batch file to read in a text file
> (which contains a list of filenames) and move each of
> those files elsewhere.
Try this:
@nospam.echo off
if %1## == ## goto arg_error
if %2## == ## goto arg_error
for /F %%a in (%1) do move %%a %2
goto end
:arg_error
echo Usage: fp.bat input_file dest_dir
:end
... where fp.bat is the name of the batch file. I tested this with a text
file containing the names of three files, one to a line, and it worked fine.
Anthony Langsworth
Software Developer
Altiris, Inc.
Ph: +612 8925-4512
Fax: +612 8925-4599
Mobile: +61 0412 249 269
http://www.altiris.com <http://www.altiris.com/>
Have you registered for the SMS Management Conference?
http://www.altiris.com/smsconference
-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.