Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I make .bat (batch files) invisble???

Status
Not open for further replies.

Oxymoron

Technical User
Dec 17, 2000
168
GB
I want to execute a batch file (which launches a java app) however.
This works, but leaves with it the open cmd.exe window, is there any environment variable or command within batch files to make the cmd window invisible...

Or perhaps even, another way of launching a java file? Just any way to launch the class without the window (It's supposed to be a background app)

All comments VERY much appreiciated,
Oxy we are all of us living in the gutter.
But some of us are looking at the stars.
 
Can you use the "Exit" command in your batch file?
 
tried, doesn't do anything we are all of us living in the gutter.
But some of us are looking at the stars.
 
It would be helpful if you posted the batch file. My testing of batch files using the "EXIT" command that linney suggested closed the CMD window as it should.
 
--------------------reminder.bat-----------------------
@echo off
cd C:\Documents and Settings\Joseph Wardell\My Documents\Aberystwyth\Semester 2\CS124\Java\Reminder
javac *.java
java Window
exit
-------------------------------------------------------

sorry i didnt explain myself when i said exit didn't work, it does, but a java app is running . It is not until this is closed that execution of the bat file can continue to the exit command.

Anyway way of executing the java file, and closing the cmd window while it's running???? we are all of us living in the gutter.
But some of us are looking at the stars.
 
I used to have tools called hide.exe and hidden.exe that would launch other programs hidden... Searching and sifting on google shows a few that look like the tools I used to have. But I don't think you want to run the java components hidden... You want the DOS box to close automatically.

There is a more common method that works great. START.EXE is already in windows. When you run a program with "start" in front of it, the batch file continues processing. The DOS box will close as the java app launches. run start.exe /? to see all the options. Because you DO want to wait for the compiler to finish, you should not put start.exe in front of the javac.exe line.

@echo off
cd C:\Documents and Settings\Joseph Wardell\My Documents\Aberystwyth\Semester 2\CS124\Java\Reminder
echo "Do not close this window! Compiling..."
javac *.java
start.exe java Window
exit
 
have you tried using the batch file to copy the java file to the windows startup folder (under start menu ->program)

next time the pc is booted up the batch file will finish and the java should then startup


another option is to have a 2nd batch file (copied to the PC) and then use the 1st batch file to call it (using call command) the batch files should then run in parallel the 1st one then exiting of its own accord "Work to live, don't live to work"

"The problem with troubleshooting is that sometimes it shoots back"
 
Try calling the java applet using start. I use batch files like this:

start c:\batchfile.bat

Then the batch file passes control to batchfile.bat and closes the dos window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top