debugging script utilizing ANSI formatted screens

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
lazna
Posts: 52
Joined: 27 Dec 2012 10:54

debugging script utilizing ANSI formatted screens

#1 Post by lazna » 01 Oct 2022 03:51

Echoing text to screen is not suitable in such case, so I think about it and develop solution to send debug messages to different CMD window. It utilize ncat.exe from nmap program package and fprint.exe from this forum.

https://nmap.org/ncat/

viewtopic.php?t=7312

I am create :nc function in my script

Code: Select all

:nc
REM == Set-up netcat debug logging - EXPERIMENTAL ==
start "" /B cmd /C"printf "%~1%~2"|ncat localhost 12345"
GOTO:EOF
starting ncat server (in separate window) on scripts header by following command

Code: Select all

ncat.exe -k -l localhost 12345
than using :nc function by following way:

Code: Select all

call :nc <echoed_text> [\n]
Any comment or improovements are welcome..

Post Reply