Advertisement
npocmaka

SetESC

May 4th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. rem --set ESC symbol to esc_char variable using the PROMPT
  3. rem --by Vasil "npcomaka" Arnaudov
  4. set prompt_backup=%prompt%
  5. prompt $E
  6. echo|set /p=^^^^>%temp%\prm.bat
  7. setlocal enabledelayedexpansion
  8. for /f "delims=" %%P in ('call %temp%\prm.bat 2^>nul') do (
  9.     endlocal
  10.     set esc_char=%%P
  11.     rem echo %%P
  12.     goto :end_for
  13. )
  14. :end_for
  15. prompt %prompt_backup%
  16. set "prompt_backup="
  17. del %temp%\prm.bat /s /q >nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement