Dos Batches: write files without line endings

I have a situation when writing dos script packages. The tool that I use to calculate the CRC (checksum) of a text string requires that the text be in a file. The data I'm trying to get CRC for is the file name, but when using a package to put that file name in a text file to calculate CRC, the script package naturally puts a line ending (CR / LF) and an empty line at the end. Since this leads to a CRC error, this is a problem.

Is there a way to get a batch script file to write to a text file without adding line endings? IE to output a single line incomplete for a file?

-K.Barad

+5
source share
2 answers

<nul set /p ".=text" > file

, echo.|set /P ="text" > file

nul , echo. (btw echo. ).
.

!
Vista Win7 "" , CR.
Xp ..
( )

+9

echo.|set /P ="text" > file

: echo "text" | checksum_program.exe

CRC32DOS, -c CR s.

+5
source

All Articles