Kickers Kickers
home Student Projects no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. It does not describe an actual complete program. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; I have too many other projects of my own.

I do contract work for a living, which could include writing a program such as this. However, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project any way you please.

The Problem

The command line to launch a program is often long and unwieldy. It may require many set commands, a huge long classpath, many system parameters and many program parameters. Some of the lines might be too long even to fit on a bat file line. Further bat files require a useless, ram-wasting, command interpreter resident the entire time your program is running and a confusing DOS window. You don’t want to add yet another directory to your path just to be able to launch the application. You want to be able to start the app typing just one word.

Windows shortcuts are lame. They don’t let you specify command line parameters. They don’t let you fill in any additional information at launch time.

The Solution

You compose a custom little C or MASM program whose sole job in life is to launch your app. I call these little launch programs kickers. A kicker sets up the set environment, including the classpath, and exec’s your app passing it all the parameters. Usually the app would be javaw.exe but it could be any exe or com. Ideally the kicker would exit as soon as the app was launched (so long at that would not kill the child.) In any case, you want to keep the kicker small and fast with no user interface.

You then put this kicker either on the path or on the virtual path in the registry so that it is always accessible just by typing a single word.

The Assembly Line

It is not hard to write a kicker for one program then compile it. The kicker is totally self contained. But what if you had dozens of them to write. How could you automate the process of creating them so that anyone could do it, even someone with no knowledge of C or MASM?

One approach would be to write a file describing the kicker (perhaps a simplified bat file), then feed it to your Java program that emits an equivalent C program, execs the compiler, and puts the resulting exe on the path or in the registry. The difficulty here is customising the program to deal with differing C compilers. People who might want to use your kicker might not even own a C compiler or be afraid to install a free one.

So another approach is to write a generic kicker and patch the executable. You could either patch the data in directly into arrays big enough to handle the worst case, or you could patch in the name of a file that had the predigested data in it. You don’t want to have to pass the name of the descriptor file to the kicker on the command line. That would destroy its simplicity and convenience.

You have to be slightly devious in patching an executable to avoid triggering virus detectors. They may freak at any attempt to patch an executable. You have to give your template an innocuous extension, patch it, then rename the result.

Getting Fancy

You can also put preconditions is your kicker, e.g. minimum free disk space before it will launch the real app, must be an Internet connection before it will launch, etc.

You could have kickers that ask questions and use the answers to generate alternate command lines or set parmeters, e.g. to select which printer to use.

You could have kickers that have command line parameters they massage and pass through to the application.

The windows registry entry lets you specify the exe and the default dirctory, but no parameters. You could implement parameterless kickers purely with registry entries in Windows.


CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] Spread the Net
You are visitor number 1,111.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/project/kicker.html J:\mindprod\project\kicker.html