When using the Windows set /p and set /a commands to accept a hexadecimal value from the command line and convert it to decimal. What I need is to be able to take a decimal value and set and environment variable with its hexadecimal equivalent.
Current batch file coding:
@echo off
set HexV1=%1
set HexV2=%2
set /A DecV1=0x%HexV1%
set /A DecV2=0x%HexV2%
set /A HexV3=0x%HexV1% + 0x1
set /A HexV4=0x%Hexv2% + 0x2
set Dec
set Hex
Produces:
C:>hexmath a f
DecV1=10
DecV2=15
HexV1=a
HexV2=f
HexV3=11
HexV4=17
What I need is to be able to set HexV3
to b and HexV4
to 11.
Any suggestions?