Hi pals,
How can I write a program which will run in background without
the knowledge of the user. I mean the program should not display
anything, even a DOS prompt or a GUI. For example the program should
keep track of whether user opens any .exe file. Then the program
should be running, but no sign of it. And it should save which file
was accessed.
please help me in this.
Thomas Weidenfeller - 29 Jul 2004 09:36 GMT
> Hi pals,
> How can I write a program which will run in background without
> the knowledge of the user.
Ui, you want to write a virus, spyware? ;-)
Fortunately Java is not well suited for this kind of system
"programming". Consider using another programming language. Or even
better, consider spending your time for better things than snooping data
and invading user's privacy.
/Thomas
KC Wong - 29 Jul 2004 10:10 GMT
> How can I write a program which will run in background without
> the knowledge of the user. I mean the program should not display
> anything, even a DOS prompt or a GUI. For example the program should
> keep track of whether user opens any .exe file. Then the program
> should be running, but no sign of it. And it should save which file
> was accessed.
A Java application will keep runing as long as it still has some threads
alive, or the main method is not completed.
To avoid being seen, don't create any frames, and archive the classes into a
JAR, and specify the Main-Class attribute inside the manifest. By installing
the Java plug-in, it will create the file association of JAR files to javaw,
which executes the main class inside the JAR without a console. Google
"Executable Jar" for how to create that... for example,
http://www.captain.at/programming/java/executable-java-application.php is
one of the search results.
Of course user can change their file association and ruin the executable jar
method, but really how often does that happen? Many users don't even tidy up
their start menu and destop... and to work around that, you can always
create a shortcut to javaw with proper parameters for them.
Keeping track of user opening any .exe file, is the big problem. I don't
have any good (and clean) idea about it right now.
Antti S. Brax - 29 Jul 2004 12:55 GMT
uvdhanya@rediffmail.com wrote in comp.lang.java.gui:
> Hi pals,
> How can I write a program which will run in background without
> the knowledge of the user. I mean the program should not display
> anything, even a DOS prompt or a GUI. For example the program should
> keep track of whether user opens any .exe file.
You can't do this with Java. It is simply impossible. Use some
other language instead.

Signature
Antti S. Brax Rullalautailu pitää lapset poissa ladulta
http://www.iki.fi/asb/ http://www.cs.helsinki.fi/u/abrax/hlb/
"Disconnect this cable to shorten, re-connect to lengthen."
-- Instructions on Logitech's USB mouse extension cord.