Discussion Locked

How to run java programme at startup

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to start one of my programme which acts as "Server" at the startup of my server machine.
I tried it by adding this command in autoexec.bat
c:\java MyTest
I took care of classpath and path.After running this autoexec.bat just after theabove line i.e java MyTest I am getting message that "This programme cann't be run in Dos mode."
What I can do to solve this problem

10 replies

by fossil

add the command lien to the registry under this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
It will be executed during the startup of windows.

You could also place it in the STARTUP folder.

by vickydicky

Sorry to say but this ans will not help me b'cuz here we did not mentioned about my .class files name say "MyTest.class" which i want to execute at start up.

by srini_soma

using JToExe program you can make that file as exe and put it in startup folder. Otherwise, if possible to try to make windows shortcut and place in startup folder

by okujava

make a batch file myjava.bat:

c:\java MyTest

and put it in the autostart programm group of windows

s.okujava

by okujava

a batch file is just a text file. u need only one line of text c:\java MyTest and save it as myjava.bat. take care, that u really rename it as .bat, not as .bat.txt (per default u see no extensions on windows). type dir in dosbox to check it

by vickydicky

Yes it will work , but with this now i am facing one problem.
After starting m/c it is also running my java programme , but now i want is that, It should not open a new window. That means i want to run this java programe in the background

by okujava

if u want your prg to run in background, start it with javaw.exe...

s.okujava

This discussion is closed to new replies.