If I understand this question, you can try: certutil.exe
decode Hexadecimal:
certutil -f -decodehex some_file.hex some_file_out.ext
encode Hexadecimal:
certutil -f -decodehex some_file.ext some_file_out.hex
decode Base64:
certutil -f -decode some_file.b64 some_file_out.ext
encode Base64:
certutil -f -encode some_file.ext some_file_out.b64
@echo off
rem :: do some task #1 ::
rem :: do some task #2 ::
rem :: do some task #3 ::
rem :: ............... ::
rem :: do some task #n ::
rem :: ----------------::
rem :: decode (itself = %~f0) file in runtime
2>nul >nul (
"%__appdir__%certutil.exe" -f -decode "%~f0" "%temp%\some_file_out_sample.txt"
) || goto :^(
rem :: do some another task #1 ::
rem :: do some another task #2 ::
rem :: do some another task #3 ::
rem :: ....................... ::
rem :: do some another task #n ::
rem :: ------------------------::
rem :: when finished ::
exit /b
:^(
echo/Error decoding file & exit /b
-----BEGIN CERTIFICATE-----
IFRoaXMgaXMgZm9yIHNhbXBsZSBmaWxlIHRvIGVuY29kZS9kZWNvZGUNCg==
-----END CERTIFICATE-----
@echo off
rem :: do some task #1 ::
rem :: do some task #2 ::
rem :: do some task #3 ::
rem :: ............... ::
rem :: do some task #n ::
rem :: ----------------::
rem :: echo/ hexdecimal string to file in runtime and decode
(
echo/0000 20 54 68 69 73 20 69 73 20 66 6f 72 20 73 61 6d
echo/0010 70 6c 65 20 66 69 6c 65 20 74 6f 20 65 6e 63 6f
echo/0020 64 65 2f 64 65 63 6f 64 65 0d 0a
) > "%temp%\some_file.hex" && (
2>nul >nul %__appdir__%certutil.exe -f -decodehex "%temp%\some_file.hex" "%temp%\some_file_out_sample.log"
) || goto :^(
rem :: do some another task #1 ::
rem :: do some another task #2 ::
rem :: do some another task #3 ::
rem :: ....................... ::
rem :: do some another task #n ::
rem :: -----------------------::
rem :: when finished ::
exit /b
:^(
echo/Error decoding file & exit /b
Note: the base64 string will decode the file: "some_file_out_sample.txt/.log"
with that into file:
"This is for sample file to encode/decode"