如何显示在十六进制整数,从一个批处理文件? [英] How do I display integers in hexadecimal, from a batch file?

查看:478
本文介绍了如何显示在十六进制整数,从一个批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

echo The error level is: %ERRORLEVEL%

生成

>The error level is: 15

我想什么:

>The error level is: F

做我需要做的转换或者是有显示的数字不同的方式?

do I need to do conversions or is there a way to display numbers differently?

在正确的方向任何帮助是AP preciated,谢谢。

Any help in the right direction is appreciated, thanks.

推荐答案

只是把它写在VBScript,而不是批

Just write it in vbscript instead of batch

放的VBScript语句。下面到文件中。

put the vbscript statement below into a file.

WScript.Echo Hex( WScript.Arguments(0) )

然后运行它,简单类型这种在命令行上(在一个批处理脚本,使用for循环捕捉如果需要​​的值)

then to run it, simple type this on the command line ( in a batch script, use a for loop to capture the value if required )

C:\workspace> cscript //nologo hex.vbs 15
F

无需安装任何东西。自带的VBScript默认情况下,大多数Windows系统。

There is no need to install anything. vbscript comes by default in most windows systems.

这篇关于如何显示在十六进制整数,从一个批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆