aspose file tools*
The moose likes Java in General and the fly likes Winows 98 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Winows 98 "Autorun"" Watch "Winows 98 "Autorun"" New topic
Author

Winows 98 "Autorun"

Rick Rodriguez
Ranch Hand

Joined: Jun 02, 2001
Posts: 44
When I copy a Java program that I have coded onto a CD-ROM/CD-R disc, I want it to run automatically, once someone places this disc in their CD-ROM drive.
I install the Java Runtime environment to a directory called "jre131", on the CD's root directory. The java executable, of course, is located within the "bin" directory of that directory.
My autorun.inf file looks like this:
[autorun]
open=app.bat
icon=app.ico
Both the batch file and the icon file are located within the root directory of the CD disc, along with the autorun.inf file, of course. The app.bat file looks like this:
@ECHO OFF
cd\applica
\jre131\bin\java Application
where "Application" is the class file that I want to run and "applica" is the directory, from the root directory of the CD, where the Java program is located.
The problem is that when I place the CD in the drive, it loads the application twice. In other words, it runs the "app.bat" file twice.
Why would the appplication load twice, i.e. two copies of the application are run, when running the batch file manually only produces "one" copy of the program running in memory?
Any help on this would be greatly appreciated.
--Rick
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Doesn't sound like a JAVA problem. Sounds like an OS/CD/Batch file problem. What OS are you running this on?

GenRocket - A Test Data Generation Platform
Rick Rodriguez
Ranch Hand

Joined: Jun 02, 2001
Posts: 44
Originally posted by Gregg Bolinger:
Doesn't sound like a JAVA problem. Sounds like an OS/CD/Batch file problem. What OS are you running this on?

It's a Windows 98 OS. When I run the batch file, by itself, it makes "1" java program instances, but via Window's "autorun" feature, it gets loaded twice.
I've tried using an executable to do what the batch file does, and I have also tried running the command directly from the autorun.inf file.
I get the same results either way. I think that perhaps there is an autorun.inf configuration or perhaps an .ini file configuration that I am missing, but I can't find it.
Anyone else know what the problem may be?
[This message has been edited by Rick Rodriguez (edited December 31, 2001).]
zniter goh
Greenhorn

Joined: Sep 23, 2001
Posts: 29
are u trying to autorun your java program when the uses insert the cd in the drive
can you tell me how u install the java runtime environment on a cd is there any registry need to be done
Rick Rodriguez
Ranch Hand

Joined: Jun 02, 2001
Posts: 44
Actually, I discovered last week that the problem was that until I formatted the CD to be read by "ALL" CD-ROM drives, it kept running the autorun.inf file twice.
One of those quirky things you discover when coding I guess.
I appreciate everyone's inquiry. This problem has been solved. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Winows 98 "Autorun"
 
Similar Threads
Installation of a Swing Application
What's up with this DOS window?
How to write program to copy all data on flash drives when it plug into usb port.can it do using
Problem opening an EAR file via Deploytool
Trouble running first application