Enabling the internal debug outputs of cmd.exe

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: Enabling the internal debug outputs of cmd.exe

#16 Post by jeb » 01 Oct 2019 13:33

There is still hope :D
Last week, I accidentially activated the debug outputs on Win10, by nesting some FOR /F loops (some hundreds).

Tomorrow, I will try to search the batch files and reproduce it.

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: Enabling the internal debug outputs of cmd.exe

#17 Post by jeb » 02 Oct 2019 00:34

No, it still works.
At least with Microsoft Windows [Version 10.0.17134.1006]

By using some nested FOR /F loops, I accidentally activated the debug mode.

Code: Select all

@echo off 

set "FOR_CMD=FOR /F "tokens=1-31" %%1 in ("jeb jeb") DO ^"
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%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
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
%FOR_CMD%
echo %%1


jfl
Posts: 226
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: Enabling the internal debug outputs of cmd.exe

#18 Post by jfl » 02 Oct 2019 03:00

This seems highly dependent on the Windows 10 version:

In version 10.0.14393, this works, but the cmd shell hangs in the end.

In version 10.0.18362, this does not work (ie. there's no debug output, only the echo %%1 output), but the cmd shell silently exits.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Enabling the internal debug outputs of cmd.exe

#19 Post by penpen » 02 Oct 2019 03:09

I was a bit inaccurate, i meant:
That feature (probably) stopped working with installation of version 1903, build 18362.387 (on all pc's).
(So i couldn't get it back to work by replacing the hardware.)

Using win version 1903, build 18362.387 the nested FOR /F loops just print"jeb" to the screen and
after you press the enter key the cmd instance exists, without enabling the debug mode.
Npocmaka's method also don't enable debug mode on that version.


penpen

Post Reply