Hi all,
I would like to echo a FORMFEED control code to a screen (or a file).
echo X* causes me problems because NOTEPAD does not like x0C (wants to save a file in Unicode). If I save it as ANSI I get a plus (+) sign.
* replace X with an ALT+12 on the numeric keypad so you get a FORMFEED control code.
Any ideas how to do this so NOTEPAD will like it?
I was thinking of using a temporary file with only a x0C code in it (total file size of 3 bytes = 0C0D0A) and then appending it to the resulting file. But I would like to avoid this option if possible.
Thanks,
Saso
echo <FF> (to screen or a file)
Moderator: DosItHelp
Re: echo <FF> (to screen or a file)
Try it with "Convert decimal to hex, and bytes to chars"
http://www.dostips.com/forum/viewtopic.php?f=3&t=951&p=3305#p3305
jeb
http://www.dostips.com/forum/viewtopic.php?f=3&t=951&p=3305#p3305
jeb
Re: echo <FF> (to screen or a file)
Thanks Jeb. I did check that - but I admit - too complex for me. For now there is no solution.
This problem does not have a highest priority at the moment.
Thanks,
Saso
This problem does not have a highest priority at the moment.
Thanks,
Saso
Re: echo <FF> (to screen or a file)
WUTmiskox wrote:For now there is no solution.
Code: Select all
@echo off
call :create "%temp%\sbs2.com"
rem 0c0d0a 2 file
echo.|"%temp%\sbs2.com" 0 "$0d$0a" "$0c$0d$0a" >0c0d0a.txt
rem 0c0d0a 2 scr
echo.|"%temp%\sbs2.com" 0 "$0d$0a" "$0c$0d$0a"
pause
exit /b
:create the assembler program, by Herbert Kleebauer
echo.Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>"%~1"
echo.0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>>"%~1"
echo.?@}IKuNWpe~Fpe?FNHlF?wGMECIQqo{Ox{T?kPv@jeoSeIlRFD@{AyEKj@>>"%~1"
echo.iqe~1NeAyR?mHAG~BGRgB{~H?o~TsdgCYqe?HR~upkpBG?~slJBCyA?@xA>>"%~1"
echo.LZp{xq`Cs?H[C_vHDyB?Hos@QslFA@wQ~~x}viH}`LYNBGyA?@xAB?sUq`>>"%~1"
echo.LRy@PwtCYQEuFK@A~BxPtDss@fFqjVmzD@qBEOEenU?`eHHeBCMs?FExep>>"%~1"
echo.LHsPBGyA?@xAunjzA}EKNs@CA?wQpQpKLBHv?s`WJ`LRCYyIWMJaejCksl>>"%~1"
echo.H[GyFGhHBwHZjjHeoFasuFUJeHeB?OsQH[xeHCPvqFj@oq@eNc?~}Nu??O>>"%~1"
echo.~oEwoAjBKs?Zp`LBzHQzyEFrAWAG{EFrAqAGYwHTECIQ{coKIsaCsf{Oe~>>"%~1"
echo.CK}Ayre~CNFA{rAyEKFACrA{EKGAjbA}eKGSjNMtQFtc{OAyDGFj?{FDGQ>>"%~1"
echo.KAjNVk_OCAx@e?f{o?CosI}1EGizhljJ~H1ZeG}JBA~rACBMDGjjDG@g0>>"%~1"
goto :eof
Re: echo <FF> (to screen or a file)
Well guys, all this solutions are using 16 bit applications (.com). You can't use it on 64 bit system if you have no DOSBox installed.
In this case I see no possibility using native batch.
Regards
aGerman
In this case I see no possibility using native batch.
Code: Select all
@echo off &setlocal
:: temporary VBScript to get the character
>"%temp%\ff.vbs" echo WScript.Echo Chr(12)
for /f %%a in ('cscript //nologo "%temp%\ff.vbs"') do (set "ff=%%a" &del "%temp%\ff.vbs")
echo.%ff%
pause
Regards
aGerman
Re: echo <FF> (to screen or a file)
Is Edlin a good alternative to Notepad.
I find Edlin and Debug are still present in XP
I vaguely recall being able to put any chosen characters into a file with either Edlin or Debug,
Those were the good old days when real men only used real DOS,
and the wimps had hobbies like stamp collecting because no Windows GUI thing had happened ! !
Alan
I find Edlin and Debug are still present in XP
I vaguely recall being able to put any chosen characters into a file with either Edlin or Debug,
Those were the good old days when real men only used real DOS,
and the wimps had hobbies like stamp collecting because no Windows GUI thing had happened ! !
Alan
Re: echo <FF> (to screen or a file)
Thanx, Alanalan_b wrote:Those were the good old days when real men only used real DOS
Code: Select all
@echo off
set "scr=0c0d0a.scr"
echo N 0c0d0a.txt> "%scr%"
echo E 0100 0C 0D 0A>> "%scr%"
for %%s in (RCX 0003 W Q) do echo %%s>> "%scr%"
debug< "%scr%" >nul
del /q "%scr%"
start 0c0d0a.txt
Re: echo <FF> (to screen or a file)
Gosh, you were quick on that ! !
I am now more than a Real Man, I am a Real Old Man with vague recollections.
I am glad you were able to pick up the hint and run with it.
If I needed to use those tools now I would have Google for the "how to ...".
One thing I do remember is composing a self modifying batch script that terminated with
"CD "
and had no Ctrl Z or CR/LF or anything else following the space character.
This allowed a subsequent >> append to stipulate a directory to be changed to.
I remember the Company installed super malware protection which was fine at defending against the latest threat of a batch script with the command FORMAT,
but it really hated and quarantined/mutilated my innocent script without the expected termination.
Alan
I am now more than a Real Man, I am a Real Old Man with vague recollections.
I am glad you were able to pick up the hint and run with it.
If I needed to use those tools now I would have Google for the "how to ...".
One thing I do remember is composing a self modifying batch script that terminated with
"CD "
and had no Ctrl Z or CR/LF or anything else following the space character.
This allowed a subsequent >> append to stipulate a directory to be changed to.
I remember the Company installed super malware protection which was fine at defending against the latest threat of a batch script with the command FORMAT,
but it really hated and quarantined/mutilated my innocent script without the expected termination.
Alan