![]() |
|
[Shell] Drag-n-drop BASE64 encoder/decoder - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] Drag-n-drop BASE64 encoder/decoder (/showthread.php?tid=6063809) |
Drag-n-drop BASE64 encoder/decoder - SIM-4581439 - Apr 5, 2020 Without going into much detail I was required to encode a decent amount of files in Base64. The script below encodes/decodes either one file or many (from a directory). The script determines if a file has been encoded by looking at the header. If present, the script decodes the file, and if not, encodes it. This code isn't fool-proof however. It uses string manipulation to trim off the last three or last four characters from the object name. If what was trimmed starts with a period then the script assumes it's a file. If not, it assumes the object is a directory. This only functions for two or three character file extensions. Feel free to post any suggestions or possible upgrades to improve the functionality. Cheers! Code @echo off >NUL |