Page 1 of 1

Making something: Saving a text file as an .exe?

Posted: Fri Feb 29, 2008 9:06 pm
by Mentat
I made a little text file in notepad that just showed a 4*4 * 4*4 matrix multiplication. Bored and rather curious, I resaved the file as an .EXE . So I ran it (yes, it did run), though it did nothing.

My question is can I make the new executable do anything (besides blink a cursor) just by using notepad? I guess other files can be saved as .exes (Visual Paint# : The Paint program that makes executables! Get your copy today!). Is there some kind of hidden language that resides within?

Posted: Sat Mar 01, 2008 1:28 am
by burger2227
Renaming a file does not make it that type of file. Many files require information headers that are not in a text file. You could make the text file into a BAS file and run it. Later you could compile it.

Ted

Posted: Sat Mar 01, 2008 7:13 am
by Mentat
Well, something happens. I opened an executable in notepad, saved it as .txt, then resaved it as an .exe . Then it did the same thing as the unaltered version. Which was to print "Hello world", though I forgot to add "sleep".

And I guess these headers aren't the same as MS Word headers?

Posted: Sat Mar 01, 2008 11:57 am
by Codemss
Have you read burger's post: Renaming a file as a .EXE is not right: you need to compile it. Basically you can give any file any extension: it is just to let windows know what program to open it with. A .EXE and a .TXT file can both hold the same data.

LOL

Posted: Sun Mar 02, 2008 5:34 pm
by burger2227
Well, all you really did was save an EXE as TXT and convert it back. No wonder it worked!

If it was that easy to do why would you even need a compiler in QB? Try making a BAS file into a TXT file and renaming it EXE. The compiler changes your code to machine language. Notepad does not!

You may have noticed that the stuff in the text file was mostly unreadable. Notepad also usually converts to ANSI characters.

Ted

Posted: Sun Mar 02, 2008 9:42 pm
by Mentat
It must be the y's. They're everywhere!