Search code examples
utf-16ansi

I need convert UTF-16 to ANSI


How i can convert UTF-16 to ANSI in a .cmd file?


Solution

  • Your code has a UTF-16 LE byte-order-marker at the beginning of it, which an obfuscation technique developed on DosTips. Either remove it via a hex editor, or save this code as deobfuscate.bat and drag your script onto it:

    @echo on &setlocal
    if "%~1"=="" exit /b
    if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
    <"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1___%~x1")