• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Winows 98 "Autorun"

 
Rick Rodriguez
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't sound like a JAVA problem. Sounds like an OS/CD/Batch file problem. What OS are you running this on?
 
Rick Rodriguez
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic