Friday, May 21, 2010

If you put a java porgram in the startup folder, can you get it to run without using command prompt?

For example: If I made a program in java that I wanted to run on startup it wouldn't work without you going to command prompt and giving it the run command right?? I'm not sure but that's what I want to do. Is it possible?

If you put a java porgram in the startup folder, can you get it to run without using command prompt?
You could try typing the command you want run in notepad and saving it as a .BAT file, and put that in your startup folder.





Open notepad and type somthing like:


java -cp "c:\java_program_location\" JavaClassFileName





Then save as "YouPickAGoodName.BAT".


Just make sure it ends in .BAT (don't forget the dot)





Then stick this .BAT file in your startup folder. Running the file is the same as typing the line in it at the command prompt and pressing ENTER.


No comments:

Post a Comment