DOS批处理脚本转换字符串2十六进制
发布时间:2020-12-14 01:43:53 所属栏目:Windows 来源:网络整理
导读:如何在DOS批处理脚本中将sring转换为十六进制? 例如,将“abcd”转换为“61626364”. 因为’a’是0x61 …… 我试图从网上找到一个解决方案,但是找不到我的答案. @echo offsetlocal EnableDelayedExpansionrem Store the string in chr.tmp fileset /P "=%~1"
如何在DOS批处理脚本中将sring转换为十六进制?
例如,将“abcd”转换为“61626364”. 因为’a’是0x61 …… 我试图从网上找到一个解决方案,但是找不到我的答案. @echo off setlocal EnableDelayedExpansion rem Store the string in chr.tmp file set /P "=%~1" < NUL > chr.tmp rem Create zero.tmp file with the same number of Ascii zero characters for %%a in (chr.tmp) do fsutil file createnew zero.tmp %%~Za > NUL rem Compare both files with FC /B and get the differences set "hex=" for /F "skip=1 tokens=2" %%a in ('fc /B chr.tmp zero.tmp') do set "hex=!hex!%%a" del chr.tmp zero.tmp echo %hex% 输出示例: C:&; test.bat abcd 61626364 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Win10如何关闭家庭组服务怎么禁用或删除家庭组
- untagged – 我应该为Windows Server 2008做MCSE 2003或MCI
- windows – 如何将Azure Active Directory用户用作虚拟机用
- 64位win7/win8/win10系统注册32位控件(.OCX)
- 在Windows上监听“用我的java应用程序打开文件”事件
- .NET给我什么,Win32不是?
- 为什么有人会直接从Microsoft购买Windows Server?
- window+nginx+php环境配置 附配置搭配说明
- windows – 比较大型xml文件
- 如何在不设置环境变量或不在Windows中导航MySQL服务文件夹的
推荐文章
站长推荐
热点阅读