Skip to content

Commit 336c53a

Browse files
moscowchillclaude
andcommitted
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 <[email protected]>
1 parent 29d8132 commit 336c53a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

winPEAS/winPEASbat/winPEAS.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ EXIT /B
707707

708708
:SetOnce
709709
REM :: ANSI escape character is set once below - for ColorLine Subroutine
710-
SET "E=0x1B["
710+
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
711+
SET "E=%ESC%["
711712
SET "PercentageTrack=0"
712713
EXIT /B
713714

0 commit comments

Comments
 (0)