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
Views expressed in this blog are those of the author and do not necessary reflect those of the author's employer. Views expressed in the comments are those of the responding individual.

Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Click **here**
A JavaScript REPL for Android Devices
A Review of Kevin Mitnick's Book Ghost in the Wires
Play MP3 Files with Python on Windows
Rhino JavaScript to EXE with launch4j
Java in a Windows EXE with launch4j
A TCP Command Line Interface in Rhino JavaScript
An SMTP Server Simulator in Perl
Tracing XSLT with a Tiny Java Web Server
Understanding TRS-80 CMD Files
Why Some Web Sites will go Dark on Jan 18th
Book Review : Paull Allen - Idea Man
A 90's Experiment in Online Systems - The U.S. West CommunityLink Service