Search found 7 matches

by MtheK
03 Jan 2021 08:46
Forum: DOS Batch Forum
Topic: .bat does not always pass parameter correctly at EOF (end-of-file)
Replies: 2
Views: 732

.bat does not always pass parameter correctly at EOF (end-of-file)

I discovered a weird problem that currently occurs on Win7 and Win10. If the last line of a .bat calls another .bat, setting STDOUT to null, and passing a parameter (last in the command line), and that last line does NOT end with a CRLF (0D0Ah), then the parameter is NOT passed, causing problems if ...
by MtheK
10 Feb 2014 06:40
Forum: DOS Batch Forum
Topic: Rules for how CMD.EXE parses numbers
Replies: 40
Views: 51480

Re: Rules for how CMD.EXE parses numbers

For some weird reason, non-ADMIN, the IF fails to compare correctly if not compared with a ZERO and thus the GOTO is wrongly taken (ie: it says a NEG# is GE a POS#): C:\Windows\System32>h:\d\tools\myprogs\dostips1.bat 4 req=4, ERRORLEVEL via DSNTODAY and EL NOT(!) CHECKED PATHSET DSNTODAY,0,E,"...
by MtheK
31 Jan 2014 15:56
Forum: DOS Batch Forum
Topic: Win7 FOR fails to parse correctly if 0Ah in parsed DSN
Replies: 3
Views: 2437

Re: Win7 FOR fails to parse correctly if 0Ah in parsed DSN

This is my test input: 00000000 30783030303030323039203035383620 0x00000209 0586 00000010 362E31203220090200000D0A 6.1 2 .. Fsutil requires to be run ELEVATED, but, in any case: h:\d\TOOLS\MYPROGS\COUNTER>fsutil file createnew COUNTER.tmp 28 File h:\d\TOOLS\MYPROGS\COUNTER\COUNTER.tmp is created h:\...
by MtheK
30 Jan 2014 22:53
Forum: DOS Batch Forum
Topic: Win7 FOR fails to parse correctly if 0Ah in parsed DSN
Replies: 3
Views: 2437

Win7 FOR fails to parse correctly if 0Ah in parsed DSN

For some reason, using this command: for /f "usebackq tokens=1,2* delims= " %%i in (`type COUNTER.txt`) do set COUNTERrc3=%%i against file COUNTER.txt which contains: 0x0000020A 0586 6.1 2 ????## where '????' is 0A020000h and '##' is 0D0Ah (CRLF) the FOR fails to parse the 1st field correc...
by MtheK
30 Jan 2014 07:12
Forum: DOS Batch Forum
Topic: Rules for how CMD.EXE parses numbers
Replies: 40
Views: 51480

Re: Rules for how CMD.EXE parses numbers

My simple .BAT ain't so simple now, but I narrowed it down: specifically, using a VAR with a number OTHER THAN ZERO only works, apparently, for ERRORLEVEL: [code] C:\Windows\System32>h:\d\tools\myprogs\dostips1.bat 4 req=4, ERRORLEVEL via DSNTODAY and EL NOT(!) CHECKED PATHSET DSNTODAY,0,E,"&qu...
by MtheK
22 Jan 2014 08:02
Forum: DOS Batch Forum
Topic: Rules for how CMD.EXE parses numbers
Replies: 40
Views: 51480

Re: Rules for how CMD.EXE parses numbers

In Win7, I have a .BAT that tries to process a negative ERRORLEVEL, but does so rather poorly, and I was hoping that a better way could be found. I have a program that can do an INT3 which forces an rc of -2147483645; 80000003h. My .BAT can only seem to handle this correctly by doing this after the ...