Rob van der Woude's Scripting Pages

Batch How To ...

Base64 Encode and Decode Files


Using native CERTUTIL

CERTUTIL is native in Windows 8 .. 11 (not sure about Vista and 7).


CERTUTIL.EXE -encode myfile.b64
Credits: Christopher Heng's article "How to Embed a Background Image in CSS to Get a Self-Contained Web Page".
Note: If you intend to use the encoded file for embedding images in HTML, you may want to remove the first and last line of myfile.b64 ("-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----")


CERTUTIL.EXE -decode myfile.b64


Using third party B64

B64 by Bob Trower is a third party open source implementation of a base64 encoder/decoder.


B64.EXE -e myfile.b64
Note: B64's optional -l switch allows you to modify the line length of the encoded file, which may be useful to create a single-line file.


B64.EXE -d myfile.b64

page last modified: 2023-07-01; loaded in 0.0070 seconds