.bat line over 80 characters

December 6, 2010 at 13:38:58
Specs: Windows XP
I have the below line in my batch file, unfortunatly when replaced with the actual lines it extends the line to over 80 characters and thus fails.

if "%%b" EQU "%findthis4%" set write=%replacewith4%

Any help on how to get this to work would be appreciated.


See More: .bat line over 80 characters

Report •


#1
December 6, 2010 at 15:02:36
You should post programming related queries here:

http://www.computing.net/forum/prog...


Report •

#2
December 6, 2010 at 15:30:41
Sorry - Wasn't sure. Thanks for moving to the right place.

Report •

#3
December 6, 2010 at 20:21:16
I don't know what the problem is but I doubt that it's the line length.

This works. [Length ~234.]

===================================================

@echo off & setLocal EnableDELAYedeXpansion

if "%PATH%" equ "%PATH%" echo y
if "C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;E:\WATCOM\BINNT;E:\WATCOM\BINW;c:\util;c:\tc\bin;c:\QB45;" equ "C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;E:\WATCOM\BINNT;E:\WATCOM\BINW;c:\util;c:\tc\bin;c:\QB45;" echo OK


=====================================
Life is too important to be taken seriously.

M2


Report •

Related Solutions

#4
December 7, 2010 at 11:54:31
Changing a line in a batch file can change the whole structure and cause a whole rewrite.

Just a thought

if "%%b" EQU "%findthis4%" goto :next
:next
set write=%replacewith4%

or
if not "%%b" EQU "%findthis4%" goto :error
:error
echo some text
pause
goto :start

Perhaps if you posted the whole bat it could be tested out.


Report •


Ask Question