VOGONS

Common searches


Reply 20 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i tested 3 programs and 1 dos command below
DDIR.EXE
EGALASER.COM
TOGGLE.COM
dir

the results were below
ERRLVL.COM DDIR.EXE - works
ERRLVL.COM EGALASER.COM - works
ERRLVL.COM TOGGLE.COM - works
ERRLVL.COM dir - doesnt work

ERRLVL.COM DDIR - dosbox hangs and crashes
ERRLVL.COM EGALASER - dosbox hangs and crashes
ERRLVL.COM TOGGLE - dosbox hangs and crashes

ERRLVL.COM DDIR.BAT - dosbox hangs and crashes (DDIR.BAT simply has DDIR.EXE in it)
ERRLVL.COM EGALASER.BAT - dosbox hangs and crashes
ERRLVL.COM TOGGLE .BAT - dosbox hangs and crashes

@echo off
ERRLVL.COM EGALASER.COM
if errorlevel 768 echo 768 executed successfully
pause
cls

ERRLVL.COM toggle.COM
if errorlevel 0 echo toggle executed successfully

ERRLVL.COM toggle.COM ddd
if errorlevel 1 echo toggle.com doesnt have the ddd option
pause
cls

ERRLVL.COM ddir.exe *.com
if errorlevel 0 echo ddir.exe executed successfully

ERRLVL.COM ddir.exe *.xxx
if errorlevel 0 echo ddir executed successfully but no files with xxx exten
pause
cls

ERRLVL.COM dir *.com
if errorlevel 2 echo dir command executed successfully

ERRLVL.COM dir *.xxx
if errorlevel 2 echo dir command executed successfully but no files with xxx exten

ERRLVL.COM fsjfsd
if errorlevel 2 echo this means errlvl.com doesnt work with the DOS commands

i need a scenario as to what story i can use errlvl.com for properly,
so far it gives info as to if the programs ran or not, or as to if i typed the options of a program like toggle.com correctly. toggle.com's correct option is "n" or "c" and not "ddd"
i consider a collection of batch commands are a story telling , a couple of individual commands mean nothing much, but the complete collection to end the story means totally something
i am a physicist, so i dont understand many of batch operators, especially double combo operators and ,much less triple combo ones.

Reply 21 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-01-31, 02:50:
ERRLVL.COM DDIR.EXE - works ERRLVL.COM EGALASER.COM - works ERRLVL.COM TOGGLE.COM - works ERRLVL.COM dir - doesnt work […]
Show full quote

ERRLVL.COM DDIR.EXE - works
ERRLVL.COM EGALASER.COM - works
ERRLVL.COM TOGGLE.COM - works
ERRLVL.COM dir - doesnt work

As I would expect - ERRLVL runs a program and "dir" is not a program, it's a "command" internal to COMMANS.COM

ERRLVL.COM DDIR - dosbox hangs and crashes ERRLVL.COM EGALASER - dosbox hangs and crashes ERRLVL.COM TOGGLE - dosbox […]
Show full quote

ERRLVL.COM DDIR - dosbox hangs and crashes
ERRLVL.COM EGALASER - dosbox hangs and crashes
ERRLVL.COM TOGGLE - dosbox hangs and crashes

ERRLVL.COM DDIR.BAT - dosbox hangs and crashes (DDIR.BAT simply has DDIR.EXE in it)
ERRLVL.COM EGALASER.BAT - dosbox hangs and crashes
ERRLVL.COM TOGGLE .BAT - dosbox hangs and crashes

If you don't specify an extension, ERRLVL tries (in this order): pgm.BAT, pgm.COM and PGM.EXE
stopping and running when it finds a file that exists.

I'd say it's "bad practice" to use the same name for .BAT and .COM/.EXE
perhaps there's a version of DOS that will prefer .BAT at the command
line, but prefer the executable within a .BAT file - but I wouldn't expect
this to be always (or ever) be true...

If XXX.BAT contains the command: XXX
i'd expect it to loop calling inself.

If XXX.BAT invokes XXX.EXE - that should be OK.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 22 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-01-31, 02:50:
i need a scenario as to what story i can use errlvl.com for properly, so far it gives info as to if the programs ran or not, o […]
Show full quote

i need a scenario as to what story i can use errlvl.com for properly,
so far it gives info as to if the programs ran or not, or as to if i typed the options of a program like toggle.com correctly. toggle.com's correct option is "n" or "c" and not "ddd"
i consider a collection of batch commands are a story telling , a couple of individual commands mean nothing much, but the complete collection to end the story means totally something
i am a physicist, so i dont understand many of batch operators, especially double combo operators and ,much less triple combo ones.

Basically ERRLVL does two things:

If can return a specific exit-code (ERRORLEVEL)

ERRLVL 5
if errorlevel 5 echo 5
if errorlevel 4 echo 4

== Show echo only "5"

ERRLVL program [args]

Will show you what exit-code (ERRORLEVEL) was returned by the execution of program

It can also save that exit-code somewhere in memory, or to a file as either test or binary number.

It's mainly for helping test and figuring out program exit-codes, DOS doesn't offer much
in the way of ERRORLEVEL monitoring and debugging capability.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 23 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie
@ECHO OFF
ERRLVL.COM GETQ.COM

IF ErrorLevel 240 ECHO a
IF ErrorLevel 226 ECHO S
IF ErrorLevel 208 ECHO A
IF ErrorLevel 175 ECHO {spacebar}
IF ErrorLevel 156 ECHO {ENTER}
IF ErrorLevel 143 ECHO from {F1} to {F12} {left or right arrow key} basically any key
IF ErrorLevel 2 ECHO s
IF ErrorLevel 0 ECHO Q or q

getQ.com error=0 if q or Q is pressed and all other key for error=1
with this ERRLVL.COM GETQ.COM combo, maybe you can make a better "choice batch command" that can let me work with {enter},{spacebar},{bksp} and etc. but errorlevel is NOT unique, if errorlevel is 156 then it is also 155 154 153..... down to 0 with it

i am gonna use this ERRLVL.COM GETQ.COM at least once somewhere, so that i have a batch reference with which to replace the choice command that WORKS with the very big {enter} and {spacebar} keys that i can just drop my hand on them to invoke something with my eyes closed. very often i am tired of pressing a specific key to do something with a choice command, and my shoulders both rotator cuffs are messed up. this is gonna be another my batch story, i found the purpose, this is gonna be a fun day

GETQ.COM is made from this code and i got it from dosbox forum
-a
mov ah,1
int 21
sub al,51
jz 10a
sub al,20
mov ah,4c
int 21
-r cx
e
-w
-q

***************************
ERRLVL 5
if errorlevel 5 echo 5
if errorlevel 4 echo 4

i am not sure what Exit[5] is, how i use it for

Reply 24 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

this was what i have done with errlvl and getq, they mimic the choice command with enter and spacebar support, cant be any better than this

OLD
choice /C:1234567890abcdefghijklmnopqrstuvwxyz /N "Q to quit or any other key to play :"
IF ErrorLevel 28 GOTO :continue
IF ErrorLevel 27 GOTO :END
IF ErrorLevel 11 GOTO :continue
IF ErrorLevel 10 GOTO :lands-ge
IF ErrorLevel 9 GOTO :lands-fr
IF ErrorLevel 8 GOTO :lands-en
IF ErrorLevel 3 GOTO :continue
IF ErrorLevel 2 GOTO :MCht-OFF
IF ErrorLevel 1 GOTO :MCht-ON

NEW
ECHO Q to quit or any other key to play (ERRLVL.COM GETQ.COM used):
SET K=E:\Utility\DOSBox\!prog1
%K%\ERRLVL.COM -Q %K%\GETQ.COM
IF ErrorLevel 201 GOTO :continue
IF ErrorLevel 200 GOTO :lands-fr
IF ErrorLevel 199 GOTO :lands-en
IF ErrorLevel 194 GOTO :continue
IF ErrorLevel 193 GOTO :MCht-OFF
IF ErrorLevel 192 GOTO :MCht-ON
IF ErrorLevel 191 GOTO :lands-ge
IF ErrorLevel 1 GOTO :continue
IF ErrorLevel 0 GOTO :END

maybe you can help me further by turning getQ.com into more general something like GetKey.com
syntax : ERRLVL.COM GetKey.COM

stage 1: (supported by getq.com, but q and Q need to be in the right errorlevel places, if errorlevels are the same ascii numbers (example: A=ascii number 65), testing would be faster and the reference is everywhere)
abc to xyz
ABC to XYZ (better if ABC...'s errorlevel numbers are the same as abc.... case insensitive)
1 to 0
{enter} {spacebar} {bksp} ~ ` - =

stage 2: by including (not supported by getq.com)
F1 to F12 {ins} {del} {home} {end} {pgup} {pgdn} {num keys} ...

stage 3:
alt + stage 1
ctrl + stage 1

getQ.com already returns a whole lot of different and unique errorlevels, so i assume it would be just a simple matter of twitching getQ.com's small code here and there
getq.com's code

-a
mov ah,1
int 21
sub al,51
jz 10a
sub al,20
mov ah,4c
int 21
-r cx
e
-w
-q
Last edited by curvedline on 2025-02-02, 12:25. Edited 1 time in total.

Reply 25 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-02, 02:15:

%K%\ERRLVL.COM -Q %K%\GETQ.COM

Not sure why you are using ERRLVL -Q ... ERRLVL is a tool I wrote to help
test working with ERRORLEVEL ... mainly to see what it is being set to (ie:
no -Q) and/or to save it in (memory/file) or run another command, passing
it as an argument.

With -Q and no -MBTC, essentially does nothing - except comsume some memory
while the argument program is running and limiting some things you could do
to with that program via DOS command shell options... Fortunately it exits
with the same exit-code as the argument program.

If it would be helpful, I could enhance it with -Pn option which would offer
Yes/No prompts for various exit-codes (of the argument program), and OR the
exit-code with (n) if 'N' is answered ... something like:

ERRLVL -QP128 %0 program arguments
rem 0 <= Blank text means 'Y'es with no prompt
rem 1 Handle errorlevel 1?
rem 5 Handle errorlevel 5?
if errorlevel 134 goto nofunc
if errorlevel 133 goto do5no
if errorlevel 130 goto nofunc
if errorlevel 129 goto do1no
if errorlevel 6 goto nofunc
if errorlevel 5 goto do5yes
if errorlevel 2 goto nofunc
if errorlevel 1 goto do1yes
:nofunc

You might also benefit from the _PAUSE.COM that I wrote to help with DosBox
not being able to abort a .BAT with ^C at PAUSE. Among other things it lets you
respond with '1'-'0' to cause exit-codes 1-10
It's in DBUTILS.ZIP on my site!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 26 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

getQ.com is a 14 byte size file
getQ.com download link is below
https://mega.nz/file/HAw2yAYA#TbKFl_33aKwAvIa … NpbqGznQNt4AHkQ

you can run this batch
@ECHO OFF
:BEGIN
ERRLVL.COM GETQ.COM
IF ErrorLevel 1 GOTO :BEGIN
IF ErrorLevel 0 GOTO :END
:END

you can keep on pressing just about any key, each key press gives you a specific errorlevel that i can use.. this is basically the function of the choice batch command

>Not sure why you are using ERRLVL -Q
once i wrote down all the errorlevels , i silenced the output , couldnt be wrong, could it?

>ERRLVL -QP128 %0
i have no idea what it is, i think you are giving me too much credit

Reply 27 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

after checking DBUTILS.ZIP
about _PAUSE.COM
*********************************
dosbox.conf was added more with
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
@echo off
mount E C:\
E:
CD \UTILITY\DOSBOX
call boxpath.bat

set TEMP=R:\
if not exist %TEMP%$DBBOOT$.BAT goto noboot
call %TEMP%$DBBOOT$.BAT
del %TEMP%$DBBOOT$.BAT
:noboot
mount R C:\UTILITY\DOSBOX
**************************
AA.BAT has
_PAUSE.COM

then i ran AA.BAT under dosbox, $DBBOOT$.BAT was created has the content below
C:
cd C:\
set BLASTER=A220 I7 D1 H5 T6
set P1=E:\UTILITY
set P2=E:\UTILITY\DOSBox-X
set P3=E:\UTILITY\DOSBox-X\BATCH
set P4=E:\UTILITY\DOSBox-X\UTIL
set PATH=Z:\;E:\UTILITY;E:\UTILITY\DOSBox-X\BATCH;E:\UTILITY\DOSBox-X\UTIL;C:.;..
set TEMP=R:\

_PAUSE.COM was a replacement for the pause command, i dont think i could make a good use of it.
(example )
testBYTE.COM CHARDATA 00000014 49 39 32
ERRLVL.COM _PAUSE.COM
IF ErrorLevel 3 GOTO :cheat2
IF ErrorLevel 2 GOTO :cheat1
IF ErrorLevel 1 GOTO :original

_PAUSE.COM produces its own errorlevel, testBYTE.COM becomes no use
_PAUSE.COM needs a whole setup of $DBBOOT$.BAT, or it works like a common pause batch command
maybe i can make a use of _pause.com if _pause.com could just stop the batch without the setup of path, temp and mount in the conf file
**************************************************************
one other interesting program i found was "find.com"
if this could give me the errorlevel, i could feel like flying.. so i checked

find.com "to" 1.txt gave me errorlevel 0
find.com "fsdfsdfjsdf" 1.txt also gave errorlevel 0... so it didnt work

ERRLVL.COM find.com "to" 1.txt gave me errorlevel 0
ERRLVL.COM find.com "fsdfsdfjsdf" 1.txt also gave errorlevel 0... so it didnt work

next i tried MS-DOS 5.0 and 6.22's find.exe and fc.exe for trials like the above, errorlevel was always 0, this means external programs do not work with dosbox, this post is getting long, so not many will read this far.

so i am gonna start a new post and ask if someone could make the simplest find.exe or fc.exe or both for dosbox's errorlevel return
thanks for a help leading me this much

Reply 28 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

is it possible to make another testbyte.com (chk2byte.com)to check 2 bytes?
testbyte.com (i renamed it chk1byte.com) was greatest when checking binary files for me
since fc and find commands were not implemented in current dosbox, i think i need a 2 byte checking utility for TEXT files, because the same bytes are too common there. even in chardata editing in the game named "legacy", 2 and 20 cant be told apart at the suitable position i wanted
if possible, i dont think i need for fc and comp commands, find is kind of too

Reply 29 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-03, 11:01:

_PAUSE.COM was a replacement for the pause command, i dont think i could make a good use of it.

_PAUSE was written specifically for DOSBOX - As I test batch files, I often sprinkle in PAUSE statements, and
under DOS - I can hit ^C at such a point to stop the .BAT

But DOSBOX doesn't support using ^C in that way. If fact there is no way (that I've found) to asynchronously
prematurely end a .BAT - so I wrote _PAUSE ('_' because PAUSE is taken within DosBox). _PAUSE supports
^C by creating $DBBOOT$.BAT on my RamDrive, and putting commands there to restore: drive, directory ,
and changed environment variables .. then it issued: config -r to restart DosBox.

My DosBox AUTOEXEC.BAT (within DOSBOX.INI) check for the presence of R:\$DBBOOT$.BAT and if
found CALLs it - thereby putting DosBox much as it can back to the place I had pressed ^C to stop a .BAT
-------------------------------------------------------------------
I didn't suggest it for the above reason ... but I also added some enhancements to _PAUSE :

You can set/control the prompt it issues.
You can have it include the current directory in the prompt.
You can have it clear (or not) the keyboard buffer before prompt.
You can press '1'-'9','0' to have it exit with ERRORLEVEL 0-10
ENTER exits with ERRORLEVEL 11
You can specify a timeout in seconds, if no key pressed in that time,
exits with ERRRORLEVEL 12
If ^C (or ESC) when told NOT to restart, exits with ERRORLEVEL 127
any other key exits with ERRORLEVEL 0

This gives you a fair bit more interactive capability in .BAT files that
the standard PAUSE

ERRLVL.COM find.com "to" 1.txt gave me errorlevel 0 ERRLVL.COM find.com "fsdfsdfjsdf" 1.txt also gave errorlevel 0... so it d […]
Show full quote

ERRLVL.COM find.com "to" 1.txt gave me errorlevel 0
ERRLVL.COM find.com "fsdfsdfjsdf" 1.txt also gave errorlevel 0... so it didnt work

next i tried MS-DOS 5.0 and 6.22's find.exe and fc.exe for trials like the above, errorlevel was always 0, this means external programs do not work with dosbox, this post is getting long, so not many will read this far.

so i am gonna start a new post and ask if someone could make the simplest find.exe or fc.exe or both for dosbox's errorlevel return
thanks for a help leading me this much

ERRORLEVEL works find in DOSBOX!

I tested and all these DO exit with ERRORLVL 0
their main purpose is to provide more information that can be givein in ERRORLEVEL
specifically:
What strings are found in what files.
What lines are different in the files.

I don't control FC, but I did write FIND, and COMP (my own file compare program)
I was just thinking about visual information when I write them, so they
currently exit normally (ERRORLEVLE 0)

What would you like to see for ERRORLEVEL?

FIND :
0 if the string was found anywhere (within filespec)?
1 if the string was not ^^

COMP:
0 if the files match exactly?
1 if the files differ?

Let me know what you'd like to see and I'll try to adjust them accordingly.

Btw, a couple of my other tools I use sometimes for this kind of thing are:
DBSC (DosBox Screen Capture) - puts screen as text into a file (which I can the process/search)
DBSCM (DosBox SCreen Match) - test for "text" within (n) last written lines to
- screen, lets you test for specific output of various commands which might not
- give what you want in ERRORLEVEL

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 30 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-03, 13:44:

is it possible to make another testbyte.com (chk2byte.com)to check 2 bytes?

TESTBYTE already can test for more than one byte (at the same location) ... but
I gather would like a TSTSTRNG which would test for certain strings, something like:

TSTSTRNG file {line-line}text [{line-line}text]...

{line-line} means "text" must occur within this line range (or just {line} for 1 line)
(if NOT given, could occur on any line)

You could specify multiple strings, and ERRORLEVEL would indicate which string was
found FIRST! (0 if none of the strings were found)

If that would work, I could whip it off fairly quickly.. let me know (and if not, be a
bit more explicit in what you want)

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 31 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member

It seems to me as if you are looking for a way to uniquely identify certain
files - Looking for bytes/strings is not the best way as it becomes very
difficult to find a set that won't match somewhere else.

A method I often use is to look at the size and calculated CRC of a file.

A CRC is like a checksum, but much harder to "fool", consider:

1 2 3 4 - checksum = 10 -> There are *many* combinations
3 1 4 2 - checksum = 10 -> of 4 bytes which will
5 0 5 0 - checksum = 10 -> give the same checksum

A CRC (Cyclic Redundancy Check) is sensitive to the actual
values and positions of those values. None of the above has
the same CRC.

To handle larger files, you probably want to store/compare a
32-bit size value, and for very good CRC you probably also want
to store/compare a 32-bit CRC.

To specify those in Hex would take 16-characters.
.. but .. if you use more characters, you can store more
bits in a character. I like to use base-64: 0-9 a-z A-Z . ;
This lets me enter a 64-bit file identifier as 11 charcters.

So, I propose a file ID tool:

SIZCRC filename [11-char IDs]...

It would return ERRORLEVEL of which ID matches the file.

If you don't specify any IDs. It would show the ID value
which identifies that file.

eg:
>SIZCRC file1.bin
SizCrc: gQ.uZ8pDX7

>SIZCRC file2.bin
SizCrc: 4uTJAc68Wu

>SIZCRC file3.bin
SizCrc: ft9;6.d5Q0

>SIZCRC file4.bin
SizCrcL xfN66bEfog

> SIZCRC file3.bin gQ.uZ8pDX7 4uTJAc68Wu ft9;6.d5Q0 xfN66bEfog
=> ERRORLEVEL is 3

> SIZCRC file2.bin gQ.uZ8pDX7 4uTJAc68Wu ft9;6.d5Q0 xfN66bEfog
= ERRORLEVEL is 2

> SIZCRC file5.bin gQ.uZ8pDX7 4uTJAc68Wu ft9;6.d5Q0 xfN66bEfog
= ERRORLEVEL is 0 <= This file does not match any CRCs entred

Note1: If we make the value size:crc, it will always be at least 6 chars
(to cover the CRC) but would be <11 for smaller files (leading 0's on size)

Note2: If we drop to 16-bit size and CRC, the ID values would drop to 3-6 chars
- this would still give very good ID (size would have to have the size%65536 value),
and a 16-bit CRC is still considered very good - the chances of you wanting to test
two files which differ but have the same 6-char ID value would be so low I wouldn't
bother to worry about it.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 32 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>I was just thinking about visual information when I write them, so they currently exit normally (ERRORLEVLE 0)

FIND .com
0 if string was found
1 if not found

COMP.com
0 if the files match exactly. (i dont care time created, modified time, access date all these high power options)
1 if the files differ

this would be perfect,
i assume, since dosbox uses the DOS version below 6.22, it should be case insensitive as if "find /I" command was automatically used, and -Q option will be also helpful, or it should let me use 1>nul 2>nul in front of it

thanks very much for this

Reply 33 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-04, 11:08:
>I was just thinking about visual information when I write them, so they currently exit normally (ERRORLEVLE 0) […]
Show full quote

>I was just thinking about visual information when I write them, so they currently exit normally (ERRORLEVLE 0)

FIND .com
0 if string was found
1 if not found

COMP.com
0 if the files match exactly. (i dont care time created, modified time, access date all these high power options)
1 if the files differ

this would be perfect,
i assume, since dosbox uses the DOS version below 6.22, it should be case insensitive as if "find /I" command was automatically used, and -Q option will be also helpful, or it should let me use 1>nul 2>nul in front of it

thanks very much for this

It's never that simple ... FIND can look for multiple strings, in multiple files...
so what constitutes "found" ..
Found 1 string in at least 1 files
Found all strings in at least 1 file
Found at least 1 string in all files
Found all strings in all files

COMP can compare multiple files (or entire directories)
so what constitutes "same"
At least 1 file matches
All files match
When comparing dirs, do extra/missing files count?

Have you considered the SIZCRC tools I suggested?
This would let you uniquely ID many files, and know which
if them is the one you select...

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 34 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>TESTBYTE already can test for more than one byte (at the same location)
not the same location.
chk1byte was named as meaning checking 1 byte location with possible multiple testing bytes
chk2byte could mean checking the locations of 2 bytes with a single testing bytes or possible multiple testing bytes
so i was thinking more of this way, possible syntaxes of CHK2BYTE.COM would be like these below
CHK2BYTE.COM DUNE.CFG 00000008 00000009 31 5C
CHK2BYTE.COM DUNE.CFG 00000008 00000009 315C
CHK2BYTE.COM DUNE.CFG 00000008 315C (the 2nd location will be 1st location + 1)
CHK2BYTE.COM DUNE.CFG 00000008 0000346F 315C (1st and 2nd locations are not consecutive, it is better but i do not expect this much)

or if multiple test input possible
CHK2BYTE.COM DUNE.CFG 00000008 00000009 315C 792E 003D (if time consuming and needs heavy editing and modifying the code, it is perfectly ok if the multiple test input is not implemented)

>TSTSTRNG file {line-line}text [{line-line}text]...
it seems the same as find.com, if find.com's errorlevel 1 is available, chk2byte.com is no longer needed, however i thought it might be good to have both
CHK1BYTE
CHK2BYTE
in case, suddenly when chk1byte turns into a chk2byte scenario, then i could easily modify the batch since they share a similar syntax.
but once find.com and comp.exe are available, i dont think i need CHK2BYTE.com. but if CHK2BYTE.com can be easily made, then please make too, i am already familiar with testbyte.com(CHK1BYTE.com)'s syntax

Reply 35 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>It's never that simple ..
>Found 1 string in at least 1 files
yes this one is all i need for a minimum trouble

>Found all strings in at least 1 file
>Found at least 1 string in all files
>Found all strings in all files
this could be more perfect like current windows OS and DOS 6.22, but i cant ask of this much, the ultimate one, but i know the current find.com you wrote could do this, and for that you can add more errorlevels you desire
... and besides if it doesnt return the value like "/C count" like real DOS to a batch file, i have no real use for it, for anything that dosbox can NOT do, i can run the ztree in the windows' background to support all these visual confirmations almost instantly, but ztree CAN NOT control the dosbox batch directly, windows DOS batch has to make all the preparations (find copy errorlevel and etc) before loading the final dosbox , (example) so far it was done only one case for "eye of the beholder 1" which doesnt have the user-interface for save load quicksave functions, so i made those user-interface with a windows batch for the game, then call dosbox once preparation was done. that win-batch cant be run in dosbox. i think more explanation of it is gonna make you fall asleep

>COMP can compare multiple files (or entire directories)
>so what constitutes "same"
>At least 1 file matches
>All files match
>When comparing dirs, do extra/missing files count?
i also checked your comp.com when i checked find.com, it could do all of the above, you can add more errorlevels you desire

>Have you considered the SIZCRC tools I suggested?
not yet, but i am getting to it, i heard of crc and chksum, but i had no idea what those were

Last edited by curvedline on 2025-02-04, 13:41. Edited 2 times in total.

Reply 36 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member

I decided on the name: IDSIZCRC
and just "ripped out" a simple one with 32-bit (2 x 16) ID values (Max IDstring is 6 chars)

And I've uploaded IDSIZCRC.ZIP to the /Drop area of my site...

Give it a try - to see how it works, run IDSIZCRC with no arguments.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 37 of 49, by curvedline

User metadata
Rank Newbie
Rank
Newbie

> IDSIZCRC
wow and wow!

1st you said base-64: 0-9 a-z A-Z . ;
now IDSIZCRC has a different set of base 64 0-9 a-z A-Z . _
why is it? havent they decided to make a set of universal notations?

******************************************
(example), i used dune2.exe as the test file

@echo off
rem IDSIZCRC.COM was renamed to crc.com to avoid typo in batch
crc.com dune2.exe COxKF2
if errorlevel 1 goto :genu
if errorlevel 0 goto :fake

:genu
echo genuine
goto :end

:fake
echo fake
goto :end

:end
pause

then modified the 1st address of dune2.exe with a byte that was something different, called it as dune2f.exe
crc.com dune2f.exe returned gTGKF2

if game companies decide to put a file modification protection with CRC checking in their games, there is no way for someone like me can break it
i can name at least two games that have a file modification protection in them, that is... harry potter 1 and 2 and battle isle 4 Incubation, you can not rename or delete any files in them, but you CAN paint their logo BMPs with different colors, if i can NOT delete or bypass logos and ads, i color them with one different color, BUT after what i learned from IDSIZCRC.COM, they never had the CRC checking in them, which is simple and so effective, i dont know what i learned from you here yet but this was educational and really good and helpful.
is this crc checking or a chksum checking, either way, i think i am gonna need the crc utility that comes with errorlevel for windows DOS batch

the filesize and CRC (whatever this is) combination turn something into a unique file ID, now i know at least, when they said "check chksum", what they meant and what they were after
i am gonna go and learn how to calculate chksum or crc, if it is not much trouble for you, you can add an example for me how to calculate in decimal number then turn it into a base 64 number, or by adding few words in theory

>Max IDstring is 6 chars
how big a file can it make with 6 bytes? a terra byte file size maybe?

PS
where is the drop link? i couldnt find it, it says not found, i have to type in https://dunfield.themindfactory.com/Drop/IDSIZCRC.zip

cant believe what i just learned... thanks truly much

Reply 38 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-04, 15:54:
> IDSIZCRC wow and wow! […]
Show full quote

> IDSIZCRC
wow and wow!

1st you said base-64: 0-9 a-z A-Z . ;
now IDSIZCRC has a different set of base 64 0-9 a-z A-Z . _
why is it? havent they decided to make a set of universal notations?

>Max IDstring is 6 chars
how big a file can it make with 6 bytes? a terra byte file size maybe?

PS
where is the drop link? i couldnt find it, it says not found, i have to type in https://dunfield.themindfactory.com/Drop/IDSIZCRC.zip

Just like I decided that IDSIZCRC would be a more meaningful name, when I was actually writing it,
I decided that '_' was better than ';' - for a couple reasons... '_' is considered q valid symbol character in
some programming languages (like C) - while ';' has more meaning in some places (often used to start a
comment in ASM as such (a lot of my own .INI parsers accept ';' as a line comment...
'.' is OK, as it's almost universally accepted as part of a filename for example.

To encode 6-bits/character I need 64 chars (2**6) '0'-'9' + 'a'-'z' + 'A'-'Z' only gives 62 so I needed two more...

IDSIZCRC should work with any size file - although the IDstring only encode 16
bits worth of the length, as long as it matches the lower-16 bits of the actual file
size it would accept it. So, for example, if you have a file that's 123456 bytes big.
That works out to HEX 0001:E240 The IDstring would encode the "E240" which is
57920 in decimal .. for a file to match ID it would have to be a exactly 57920+(65536*?)
bytes in size: 57920, 123456, 188992, 254528 ...
AND have the same 16-bit CRC. The chances of this occurring at random is very
unlikely (If I wanted, I could make two different sized files produce the same IDstring,
but it would take some work - and they would have to have been specifically created
for that purpose!)

There is no "link" to the drop area - It's a "semi private" area that I don't publish and
only give names of files contained therein to people I want to be able to get them.

Probably last time I put the complete URL into a posting here, and all you would have had to
do is cut/paste (or I think Vogons recognizes URLs in postings, so all you might have had to do
was "click" on it) ... but unless I post a link, you would have to go to my site, then add
/Drop/filename
to the URL in your browser.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 39 of 49, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-04, 15:54:

is this crc checking or a chksum checking, either way, i think i am gonna need the crc utility that comes with errorlevel for windows DOS batch

IDSIZCRC is using a CRC, not a checksum.

Checksums are too easy to fool ...

i am gonna go and learn how to calculate chksum or crc, if it is not much trouble for you, you can add an example for me how to calculate in decimal number then turn it into a base 64 number, or by adding few words in theory

Calculating a checksum is easy ... just add up the bytes (or words if you are doing a word checksum)
CRC is a fair bit trickier... I included IDSIZCRCs source code (IDSIZCRC.C) in the archive I posted...

Be aware that one more understandable way to calculate a CRC from a data stream with a known
CRC polynomial has a bit more steps, works a bit at a time, is very slow, but doesn't use a precalculated
table as I did. Using the table lets it work a byte a time, is *MUCH* faster, and although the code looks
simpler, it's much harder to actually understand the math behind it...

I worked it out long ago, and now I just have some blocked of "canned" code that I drop in when
I need a CRC. (At least I do provide the code in IDSIZCRC.C to build the table from the CRC polynomial).

Like many (most) of my "quick and dirty" tools, I took the easy out on the base-64
thing... I just wrote code to convert a 32-bit number into a BASE-64 string.
( the CVTval() function) - I didn't bother writing code to go the other way...

I just store the strings you enter as arguments, and compare them to the IDstring
generated from size:CRC -> Base64 text

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal