Created
February 2, 2022 02:19
-
-
Save pmachapman/f494b76341c18ed88f830bb871b8c616 to your computer and use it in GitHub Desktop.
Drag and drop a file onto this script to create a text file containing the escape codes to use in a C++ string literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const ForWriting = 2 | |
data = "" | |
fileName = WScript.Arguments.Item(0) | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set f = fso.OpenTextFile(fileName) | |
Do Until f.AtEndOfStream | |
buf = f.Read(1) | |
data = data & "\x" & Hex(Asc(buf)) | |
Loop | |
f.Close | |
Set f = Nothing | |
Set f = fso.CreateTextFile(fileName & ".txt", True, False) | |
f.Write(data) | |
f.Close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment