1.

Solve : combining two commands into one?

Answer»

If a batch file is used to copy a file to two locations, can that be done in one line (if so how ?), or does it require two copy commands ?QUOTE from: Sebastian42 on July 04, 2010, 02:48:47 AM

If a batch file is used to copy a file to two locations, can that be done in one line (if so how ?), or does it require two copy commands ?

The syntax of the copy COMMAND is shown in the help you see if you type copy /? at the prompt. Basically in its simplest form it consists of

copy [SOURCE] [DESTINATION]

You can make source be more than one file by using wildcards, for example copy *.txt foldername but destination can only be one thing - one file or one folder.

However you can put more than one command on one line if you use the & CHARACTER, for example:

copy file1.txt "C:\A folder" & copy file1.txt "D:\Another folder"











Discussion

No Comment Found