不知这是否你想要的?- @if (0)==(0) echo off
- set /p str=输入你要转换的字符串:
- set /a nIndex=0
- :_GetHexCode
- call set tmpChr=%%str:~%nIndex%, 1%%
- if "%tmpChr%" == "" echo,&goto :_end
- for /f "tokens=*" %%i in ('cscript -nologo -e:jscript %~0 %tmpChr%') do set/p=0x%%i <nul
- set /a nIndex+=1
- goto :_GetHexCode
- :_end
- pause&goto :EOF
- @end
- WScript.echo(WScript.arguments(0).charCodeAt(0).toString(16));
复制代码
|