Here is my solution for this string replacement task using only internal commands of cmd.exe with exception of FINDSTR.
@echo off
setlocal EnableExtensions DisableDelayedExpansion
if not defined workingPlace set "workingPlace=%~dp0"
set "TextFile=%workingPlace%bin\csm.properties"
if not exist "%TextFile%" goto EndBatch
set "TempFile=%TEMP%\csm.properties.tmp"
set "FoundInfo="
(for /F delims^=^ eol^= %%I in ('%SystemRoot%\System32\findstr.exe /N "^" "%TextFile%"') do (
    set "Line=%%I"
    setlocal EnableDelayedExpansion
    set "Line=!Line:*:=!"
    if not defined FoundInfo (
        if defined Line (
            if /I "!Line:~0,10!" == "CLASSPATH=" (
                if /I "!Line!" == "CLASSPATH=" (
                    echo !Line!plugins/Numbering.jar
                    endlocal
                    set "FoundInfo=1"
                ) else if "!Line:plugins/Numbering.jar=!" == "!Line!" (
                    set "Line=!Line:~0,10!plugins/Numbering.jar\:!Line:~10!"
                    echo !Line!
                    endlocal
                    set "FoundInfo=1"
                ) else (
                    endlocal
                    goto DeleteTempFile
                )
            ) else (
                echo(!Line!
                endlocal
            )
        ) else (
            echo/
            endlocal
        )
    ) else (
        echo(!Line!
        endlocal
    )
))>"%TempFile%"
if not defined FoundInfo echo CLASSPATH=plugins/Numbering.jar>>"%TempFile%"
move /Y "%TempFile%" "%TextFile%"
:DeleteTempFile
if exist "%TempFile%" del "%TempFile%"
:EndBatch
endlocal
Read my answer on How to read and print contents of text file line by line? why command FINDSTR is used just to output every line in file csm.properties including empty lines ignored by FOR by default with line number and : to avoid that any line is ignored by FOR. The line number and the colon is removed by the command line set "Line=!Line:*:=!".
There is the environment variable FoundInfo undefined at top of the batch file and which is set once a line starting case-insensitive with CLASSSPATH= is processed by the inner code of FOR loop. Every line in file after the line starting with CLASSSPATH= is just output without further processing including empty lines.
An empty line above line starting with CLASSSPATH= is also output with echo/ without any further processing.
The first line starting case-insensitive with CLASSPATH= can be processed in three different ways:
- The line contains just CLASSPATH=.
 In this case the line is output asCLASSPATH=plugins/Numbering.jarand that's it.
- The line starts with CLASSPATH=and contains one or more characters, but not case-insensitive the stringplugins/Numbering.jar.
In this case the line is output within insertingplugins/Numbering.jar\:afterCLASSPATH=.
 Please note that a line with justCLASSPATH=and one or more trailing spaces/tabs would result also in running into second branch resulting for example in output ofCLASSPATH=plugins/Numbering.jar\: with\:and the trailing whitespaces at end.
- The line starts with CLASSPATH=and contains already case-insensitive the stringplugins/Numbering.jarsomewhere on the line.
 In this case the FOR loop is exited immediately with a jump to labelDeleteTempFilewithout processing any further line from captured output of FINDSTR. So the last modification date of the file does not change because of nothing changed on file content. (I don't like a change last modification date on file content not really modified.)
After the FOR loop is checked if there was any line starting case-insensitive with CLASSPATH= at all in the file. The line CLASSPATH=plugins/Numbering.jar is appended to the temporary file if that was not the case.
Finally with temporary file definitely being different to csm.properties, the temporary file is moved over existing file csm.properties if that is possible at all and last the temporary file is deleted if it is still existing.
Note 1: The solution could be easier without usage of FINDSTR if file csm.properties contains no empty lines or it is acceptable that empty lines are removed during the update of line with CLASSPATH=.
Note 2: The line with CLASSPATH= at top of file csm.properties reduces the process time.
Summary of features of this solution:
- Does not modify the text file on containing already CLASSPATH=withplugins/Numbering.jarsomewhere on line.
- Inserts plugins/Numbering.jar\:afterCLASSPATH=only if there are other class paths (or trailing whitespaces) on this line.
- Appends plugins/Numbering.jarto existingCLASSPATH=line not containing any other class path (and no trailing whitespaces on this line).
- Appends entire CLASSPATH=line withplugins/Numbering.jarto file not containing this line at all if the file exists at least.
- Keeps empty lines in text file and so modifies really only line with CLASSPATH=at beginning.
- Does not modify lines with VARIABLE==value(value with equal sign at beginning) toVARIABLE=value(equal sign at beginning removed).
- Does not modify spelling of CLASSPATH=and works for that reason also withclasspath=orClassPath=in file.
- Does not remove lines starting with ;being default of FOR's end of line option (eol).
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.
- del /?
- echo /?
- endlocal /?
- findstr /?
- for /?
- goto /?
- if /?
- move /?
- set /?
- setlocal /?
See also Why is no string output with 'echo %var%' after using 'set var = text' on command line? and How to set environment variables with spaces? These answers explain why in most cases set variable="value" is not good and what is the difference to set "variable=value" which is the preferred syntax for definition of an environment variable with a string value.
See also Symbol equivalent to NEQ, LSS, GTR, etc. in Windows batch files explaining how string comparison works with command IF and why the operators EQU and NEQ designed primary for integer comparisons should be in general not used for comparing two strings although this is possible. The usage of EQU and NEQ for string comparisons can in some cases with not double quoted strings result in an unexpected comparison result.