开发者

DOS command to format string to hex value

开发者 https://www.devze.com 2022-12-17 19:40 出处:网络
Is it possible to format a string to a hex value using DOS command? I\'m trying to pass a hex value 开发者_如何学Cto my program from command line but it takes that complete value a a string and not as

Is it possible to format a string to a hex value using DOS command? I'm trying to pass a hex value 开发者_如何学Cto my program from command line but it takes that complete value a a string and not as hex value?


Forget about Peak Oil, what about Peak DOS? It's time to look to the future. And the future is PowerShell.

PS >  "{0:x4}" -f ([int]"999")
03e7


I'm not sure about a DOS command, but you can use Windows Calculator to do this... Just put it into Scientific Mode (the View menu), then put it into Decimal mode (also the View Menu), then type the number, then put it into Hex Mode (again, in the View menu). It will show you the corresponding Hex value for the decimal number you entered.


No it only passes strings. You need to do the conversion to hex from inside your program.

0

精彩评论

暂无评论...
验证码 换一张
取 消