Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Very Long Lines in BAT File

3 views
Skip to first unread message

Daniel J. McKinley

unread,
May 1, 1998, 3:00:00 AM5/1/98
to

Is there a way to break a very long command line in a bat file?

On UNIX you can use the backslash character like this:

copy very_very_very_very_very_very_long_file_name1 \
very_very_very_very_very_very_long_file_name2

Is there some equivalent way in the DOS world?

Please email a response to either address below:

dan.mc...@cnfd.pgh.wec.com
McKi...@westinghouse.com

--
--
Dan.Mc...@cnfd.pgh.wec.com (412)-374-2497

Tom Lavedas

unread,
May 4, 1998, 3:00:00 AM5/4/98
to Daniel J. McKinley

Daniel J. McKinley wrote:
>
> Is there a way to break a very long command line in a bat file?
>
> On UNIX you can use the backslash character like this:
>
> copy very_very_very_very_very_very_long_file_name1 \
> very_very_very_very_very_very_long_file_name2
>
> Is there some equivalent way in the DOS world?
>
> Please email a response to either address below:
>
> dan.mc...@cnfd.pgh.wec.com
> McKi...@westinghouse.com

The short answer isNo, there is no equivalent". Further, depending on
the version of DOS running, the total length of a command line is
limited either 127 or 250 (Win 95, with /U:250 on SHELL=... line in
CONFIG.SYS file). However, within these limits some accommodation for
long lines can be made through the application of environment variables.

Assuming there is enough space in the environment, a variable or two can
be used to construct the complete line in pieces, something like this
...

set cmd=copy very_very_very_very_very_very_long_file_name1
%cmd% very_very_very_very_very_very_long_file_name2
set cmd=

or

set vlfn1=very_very_very_very_very_very_long_file_name1
set vlfn2=very_very_very_very_very_very_long_file_name2
copy %vlfn1% %vlfn2%
for %%v in (1 2) do set vlfn%%v=

That's about all that can be done.

Tom Lavedas
-----------
Delta Electronics, Inc.
http://www.deltaelectronics.com/tglbatch/

Mike Mason

unread,
May 4, 1998, 3:00:00 AM5/4/98
to

Daniel J. McKinley wrote:
>
> Is there a way to break a very long command line in a bat file?
>
> On UNIX you can use the backslash character like this:
>
> copy very_very_very_very_very_very_long_file_name1 \
> very_very_very_very_very_very_long_file_name2
>
> Is there some equivalent way in the DOS world?
>
> Please email a response to either address below:
>
> dan.mc...@cnfd.pgh.wec.com
> McKi...@westinghouse.com
>
> --
> --
> Dan.Mc...@cnfd.pgh.wec.com (412)-374-2497
What is the command? Is it a path= statement or what? More info please
--
The views expressed here are certainly not the views of Unisys Corp.

"I can't take it no more...I'm buggin out!"
Raybeez-The Way It Is Compilation

Please whatever you do, do not go to this website!
http://www.geocities.com/SunsetStrip/Towers/3757/

Thomas Cato Christopher Almnes

unread,
May 6, 1998, 3:00:00 AM5/6/98
to

Mike Mason wrote:
>
> Daniel J. McKinley wrote:
> >
> > Is there a way to break a very long command line in a bat file?
> >
> > On UNIX you can use the backslash character like this:
> >
> > copy very_very_very_very_very_very_long_file_name1 \
> > very_very_very_very_very_very_long_file_name2
> >
> > Is there some equivalent way in the DOS world?
> >
> > Please email a response to either address below:
> >
> > dan.mc...@cnfd.pgh.wec.com
> > McKi...@westinghouse.com
> >
> > --
> > --
> > Dan.Mc...@cnfd.pgh.wec.com (412)-374-2497

Why not just renaming the file to a shorter filename...:-<>

\t


---
IN THE RIVER!

Thomas Almnes | alm...@mail.com
http://www.ifi.uio.no/~thomaa

0 new messages