Originally published on: Fri, 07 Aug 2009 00:35:49 +0000
Some time ago, I needed to provide a desktop shortcut for an application. Rather than using the normal shell API's to create a shortcut on the Windows desktop, I wondered if I could make an EXE tiny enough so that it was almost the same size as a typical shortcut.
I used this pet project as an excuse to learn a little about the Netwide Assembler (NASM32). I opted to use some of the Visual C++ 5.0 runtime libraries and linker, so my NASM code probably looks different than most you'll see elsewhere.
I wrote a small program that simply calls WinExec passing in "notepad.exe" as the argument.
The resulting EXE is about 2K in size ... bigger than most of my shortcuts, but a worthwhile effort. I had rewritten this so that it would work properly with a separate linker and had gotten the EXE down to a very tiny size. Unfortunately, I no longer have that source.
To assemble and link this program, I used the following batch file:
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
Screen Captures with Java and Clojure
BSave and BLoad for the Commodore 64
Auto Save Clipboard Images Redux
A Simple Media Control Interface Script Processor
Book Review : Using Google App Engine
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer