Page 2 of 2

Re: Enabling the internal debug outputs of cmd.exe

Posted: 02 Oct 2019 00:34
by jeb
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%
%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%
%F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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%
echo %%1


Re: Enabling the internal debug outputs of cmd.exe

Posted: 02 Oct 2019 03:00
by jfl
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.

Re: Enabling the internal debug outputs of cmd.exe

Posted: 02 Oct 2019 03:09
by penpen
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