The
( . . .
) construct might be a syntax extension of Windows 7 but i don't believe it would work under true (original) DOS.
However, when thinking a little about it, i could imagine a small tool could be written, which implements some kind of equivalent to the UNIX shell "here documents". In the latest versions of two of my tools (SELECT and FORM) of my DOSUTILS package (which is available here:
http://www.bttr-software.de/products/jhoffmann/) i already implemented something similar.
It looks a little bit different compared to its UNIX counterpart but serves the same purpose. The basic idea is to prefix the lines which are intended to go to the program rather than to command.com with a special prefix, which causes the batch processor to regard them as comment and in addition help the program which reads the batchfile to identify the lines it should read.
Currently this only works for the two above mentioned programs which are especially designed for that pupose. But one could write another little tool (let's call it "heredoc") which just reads such lines, removes the prefixes and copies the rest to its own stdout channel. This could then be piped into any other program which is capable of taking commands from stdin. As an example, this is how it could look like:
rem-1 user username password
rem-1 ls -R outfile.txt
rem-1 quit
heredoc rem-1 %0 | ftp
The program "heredoc" (which is the one that would have to be written) looks for lines prefixed with a text specified by its first parameter (in this case "rem-1") in a file specified by its second parameter, in this case represented by "%0" which is the name of the batch-file itself. After stripping off the prefixes it sends those lines to "ftp". As the respective lines all start with the character sequence "rem", command.com regards them as comments and ignores them.
But who really wants such a program?