Fix ANSI escape codes displaying as literal text in winPEAS.bat

The script was setting E=0x1B[ as a literal string instead of the actual
ESC character (ASCII 27), causing color codes to display as text like
"0x1B[33m[+]0x1B[97m" instead of rendering as colors.

Changed the SetOnce subroutine to properly capture the ESC character using
the 'prompt $E' technique before building the ANSI escape sequence prefix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
moscow chill
2025-10-29 20:16:34 +01:00
parent 29d8132d93
commit 336c53a163

View File

@@ -707,7 +707,8 @@ EXIT /B
:SetOnce :SetOnce
REM :: ANSI escape character is set once below - for ColorLine Subroutine REM :: ANSI escape character is set once below - for ColorLine Subroutine
SET "E=0x1B[" for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
SET "E=%ESC%["
SET "PercentageTrack=0" SET "PercentageTrack=0"
EXIT /B EXIT /B