Two Laptop Bag*
The moose likes Beginning Java and the fly likes Batch file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Batch file" Watch "Batch file" New topic
Author

Batch file

Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
I start my java program from "Start.bat"
and I would like to start it
automatically from autoexec.bat.
Would you give me an example for Windows XP please?
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Manuel if you look at the start.bat you most like to find that:
1. It has set the classpath
2. Or perhaps Path too.
Setting path means you can get your all java executable files from any directory(or path). Again classpath will let the java compile to look into the classes which it needed from the API at the time of compilation/running.
To make life easier perhaps the better way is to set these two things into the Enviorment variables of your computer and it will be available for every path..
I am sorry I don't have XP with me..you have to look into it for exact steps.
Hope it will help..
regards,
Arun
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Manuel,
I'm not sure that I understand what you are trying to do. Could you expand your explanation?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
I think that he wants his start.bat to be started everytimes he turns on his pc. Am I right Manuel?


Younes
By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Hi
Just make a shortcut of the bat-script (or the NT way your .cmd script) and put it into the 'startup' folder: Start->Programs->Startup
/Rene


Regards, Rene Larsen
Dropbox Invite
Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
Yes, I would like my "start.bat" to be started everytimes I turn on my pc.
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
if i am understanding your requirement properly and you're not satisfied with my earlier answer,perhaps writing a new line with text"c:\temp\start.bat" will work here c:\temp is the path where start.bat is laying.
Arun
Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
Thanks Arun but I think you don't understand what I need. My batch file works just fine.
I just need it to be running when I turn on my PC.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Do what Rene suggested.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
Thank you very much everybody.
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
you may also put it in your registry (key run)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Batch file