1.

Solve : Program Closes automatically, can I stop it??

Answer»

Ok So I have a basic Batch Program to Compile Java Programs USING the AVI Folder, the program works fine if I RUN it from the MS-Dos Window, however if I click on the batch file's icon, it opens MS-DOS, Runs the Program, and then Closes the Window. Is there anyway to make it keep the Window Open?

Here is the Code I have:

rem myautoxp.bat Jacob Primus

rem This file SETS the necessary environment variables to
rem be able to write and run Java programs consistently

path=.;C:\;c:\AVI;c:\WINDOWS;c:\WINDOWS\System32;c:\java;C:\j2sdk1.4.0_01\bin\

set classpath=.;c:\;C:\j2sdk1.4.0_01\src;C:\j2sdk1.4.0_01\lib;c:\java\

doskey

cd..

cls

cd f:

cd java





This should run the program and then bring me directly to my Java folder, but it closes. If I cant get this to work, I have to open MS-DOS everytime run the file, then find my java files every time. Please Help!If you just want to view the output use the pause command; this closes the DOS window after you press any key.

If you want to keep the DOS window open until you type exit, create a link to cmd.exe which calls your batch file:

Code: [Select]cmd /K <path>\<your batch file>.bat
The /k switch calls your batch file and remains in the DOS shell.

Cheers,
[glb]cs[/glb]Thank you so much, WORKED perfectly.



Discussion

No Comment Found