Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remark line cause cmd.exe crash

25 views
Skip to first unread message

Petr Laznovsky

unread,
Mar 12, 2017, 3:00:26 PM3/12/17
to
Just discovered strange thing, inserting following comment line in the long batch:

REM echo %%~b| findstr /I "%%~A"

cause cmd.exe crash on batch start.

Podpis problému:
Název události problému: APPCRASH
Název aplikace: cmd.exe
Verze aplikace: 6.1.7601.17514
Časové razítko aplikace: 4ce798e5
Název chybného modulu: cmd.exe
Verze chybného modulu: 6.1.7601.17514
Časové razítko chybného modulu: 4ce798e5
Kód výjimky: c0000005
Posun výjimky: 000000000000d9b4
Verze operačního systému: 6.1.7601.2.1.0.768.3
ID národního prostředí: 1029
Další informace 1: d593
Další informace 2: d593af95d3b1ceeb03aa816214f79e61
Další informace 3: 7b70
Další informace 4: 7b7020ec8378eafc2c23ff9e961fb62d


Windows 7 home, 64bit. There are six tab characters between REM and echo strings and CRLF at the end
of line, no more characters. Adding this line into batch cause crash, removing this line cause batch
running normally, tried many times. Trying to

Following test batch run normally:

@echo off
REM echo %%~b| findstr /I "%%~A"
echo test

Problematic line is last one in my function, putting GOTO:EOF just on the top of problematic line
does not solve the problem, cmd.exe crash anyway.


What could cause such behaviour? I discovery this by debugging why new, 10 lines, function does not
work in my old, long time working, complex batch script.

L.


JJ

unread,
Mar 13, 2017, 11:28:24 AM3/13/17
to
On Sun, 12 Mar 2017 20:00:22 +0100, Petr Laznovsky wrote:
> Just discovered strange thing, inserting following comment line in the long batch:
>
> REM echo %%~b| findstr /I "%%~A"
>
> cause cmd.exe crash on batch start.

This is impossible to reproduce without actual working code. i.e. the whole
batch file with all files involved.

> Following test batch run normally:
>
> @echo off
> REM echo %%~b| findstr /I "%%~A"
> echo test

That's an entirely different condition, so it won't crash. You'll need all
of the variables in order to reproduce the crash. It's impossible to know
what went wrong without the crash.

Petr Laznovsky

unread,
Mar 13, 2017, 9:30:38 PM3/13/17
to
Dne 13.3.2017 v 16:28 JJ napsal(a):
I expect reply like this, but my code downloading code from server API (by Xidel.exe) and I can`t
publish API credentials so no one could exact reproduce my code..... Is this insumountably
obstruction to find out what is wrong?

L.

Tom Del Rosso

unread,
Mar 14, 2017, 1:14:57 AM3/14/17
to
Petr Laznovsky wrote:
>
> I expect reply like this, but my code downloading code from server
> API (by Xidel.exe) and I can`t publish API credentials so no one
> could exact reproduce my code..... Is this insumountably obstruction
> to find out what is wrong?

Try replacing the REM statement with this:

echo b %%~b
echo A "%%~A"
echo b A %%~b "%%~A"
pause




---
This email has been checked for viruses by AVG.
http://www.avg.com

0 new messages