❔ How to Convert txt to exe or ther ways to copy a exe file from the code to somewhere help pls

(this has to be compiled in an exe file btw) I simply want to copy an exe file to a direction but visualstudios doesnt accept exe files as a resource so i thought i d import the exe file a txt file and let the program convert it back when needed to copy.
18 Replies
Pobiega
Pobiega2y ago
I simply want to copy an exe file to a direction
? you can't just open an exe file in a text editor and copy the content, if thats what you are trying to do you can however copy it with File.Copy or similar, or by just reading the bytes in a file stream
utku the liminal space enjoyer
yes but this a scenario where the file is not on the computer so i cant give it a path so it needs to be in the resource but again visualstudios is not accepting exe in the resource
Pobiega
Pobiega2y ago
you could base64 encode the bytes from the program but why are you embedding an exe in the first place? just ship it together with the program, in a zip
utku the liminal space enjoyer
yeah i thought about that but i want to find a way where its just a that executet exe that contains this exe and copys it into a folder
Pobiega
Pobiega2y ago
why? hiding another program in your program usually means shady stuff are you doing shady stuff?
utku the liminal space enjoyer
no its so i can let the programm run in the startup folder the teacher had the condition that it needs to be an exe wwhat do you mean by that? wait r gifs allowed?
Pobiega
Pobiega2y ago
yep. well, files are just bytes right
Pobiega
Pobiega2y ago
the problem is not all byte sequences are valid strings, which is why we cant just copypaste a program as a text file but if we read those bytes, as bytes, and Base64 encode it (which turns bytes into a valid string)... you could then base64 decode it and have the bytes back
utku the liminal space enjoyer
so base64 is the keyword of the topic i am looking for thx btw so i do that and id have in string thanks to that decoding stuff and then i can copy that by decoding again or something like that and put it in a spesific folder right thats it that it what i have to look for?
Pobiega
Pobiega2y ago
the way you write gives me a headache :d
Pobiega
Pobiega2y ago
so I'm gonna leave.
ZacharyPatten
ZacharyPatten2y ago
what exe are you trying to package with your app and what are you attempting to do
utku the liminal space enjoyer
just trying to autorun a exe when the computer starts so so there has to be a program (just a exe) which contains an exe which has to be copied into a folder its something like a reminder of things and the teascher said it should automatically activate autostart
ZacharyPatten
ZacharyPatten2y ago
you should ask your teacher for help then, because what you are asking us to help you with is not a typical school assignment. you have probably miss interpreted what your assignment/teacher is asking you to do
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server