How do I get the command prompt do dissapear after starting a program via a batch script? - windows-xp

I have a windows batch file which I run to start a java application. The problem is that I don't want the command prompt output to be visible after the app starts. And not only that,... I don't event want to see it minimised. I don't want it at all. Any ideas?
Cheers!!

Use
start/b javaw.exe ...

If your program is not a console application, you can use START.EXE in your batch file to actually launch the real app. The initial console used to launch the batch file will be closed when the batch file ends.
You could actually probably launch the .bat file with start /b too in order to avoid all console windows.

Related

Run a bat file when a specific application is opened in Windows XP

I want to know how can we run a bat file when a specific application is opened?
Eg: I would like to run a bat file whenever mspaint is opened.
I have successfully performed this in Windows 7 and Windows 10 using Task Scheduler. But the task scheduler available in Win Xp is very basic.
You could use another batch file that runs on startup of windows. use while loop with an appropriate sleep to detect when Paint.exe runs.
then you could write more commands to do anything you want. For example, as you said, you could run another batch file...
I found this solution by an investigation of these topics:
Syntax for a single-line Bash infinite while loop
How to check if a process is running via a batch script
Batch program to to check if process exists

Start Wildfly / JBoss from GUI

how is it possible to start JBoss (Wildfly) application server from a GUI ?
I would like to implement a own GUI like XAMPP.
Only a "start" - Button and "stop" - Button.
Maybe I have to start the .bat - file?
There is a start and stop .bat available, but how can I do this in JAVA? To implement a GUI is not the case. The question is to start / stop the server.
Any ideas?
You will have to execute the batch file by passing them to the cmd shell.
If you are developing the script for windows you can have a field that points the JBossAS/Wildfly's Home directory(or can read it from the JBOSS_HOME if its set), and then in the Java Code execute the .bat file in the following way:
Runtime.getRuntime().exec("cmd /c start standalone.bat");
Preferably you can also use the [ProcessBuilder][1] API to create a new process.
Please refer to this post for some helpful pointers

Cmd.exe no popup

I have to run cmd / c from a program, run the start command xx.exe, and I capture the result (there xx.exe?). until everything is right, however, remains open the console with the error popup. how can I close the console with the error?
Usually win32 applications will close the command prompt after execution. If this isn't the case with what you're trying to run, you could:
Run it from Windows "Run" option (Windows button+R) than your program name and path in prompt.
Run it from a batch file, like so:
runMe.bat:
START "" "C:\windows\notepad.exe"
EXIT`
Than just run runMe.bat from wherever. Notice the 'exit' command that closes the command prompt after execution.
Read more about batch files, the start command, and this issue here, and there.
Good luck!

Problem with the start /wait command

#echo off
start /wait notepad
start worpad
This is the code i have written in a batch file. My aim is to stop the batch file execution till the notepad application gets closed. Its working perfect but the thing is, Its displaying the command prompt also .Its opening the command prompt when i execute
start /wait notepad in my batch file.
The command prompt gets closed when i close my notepad. But i dont want the command prompt.How do i make that. I even tried these
cmd /c start /wait notepad
even the above command is not working. How do i make it.How do i open only notepad without the command prompt and wait till it is closed ?
As I said in my answer to one of your previous questions, the command prompt window is there because it is the tool that processes the batch file. The command prompt window is the working window of the CMD.EXE program, just like Notepad's working window is the one where you are editing text files. Typically, running a program with its working window hidden is a non-trivial task, unless the program has a pre-defined mode of running with the hidden window. As it happens, CMD does not have such a mode.
However, there is a way of starting a program with its window minimised. You only need to create a shortcut to your program (it can be a batch file too), then open the shortcut's properties, and on the Shortcut tab, set the Run property to Minimized. To make it clearer, here's an illustration:
Or maybe you can just use the
ping localhost -n ( your time in second ) >nul
So your code will be like this
#echo off
start notepad
ping localhost -n ( your time in second ) >nul
start worpad

run .exe in the background

I know that if you want to run a program in the background from a unix command line, you simply add & to the end of the command, but is there an equivalent in windows in order to run something in the background?
A low-budget way of doing this is:
start /min some.exe
This starts the program in a minimised console window, and doesn't wait for the second program to finish.
You can:
Use Windows Scheduler.
Run the exe as a Windows service.
I don't really know of a way to manually start something and have it run in the background like you can do in Unix.
Although not a definitive answer to your question there was a similar question on serverfault here:
https://serverfault.com/questions/121979/tools-to-run-a-background-process-command-line-in-windows
The closest thing in windows to the Linux & is described here from what I can tell:
http://blog.commandlinekungfu.com/2009/04/episode-23-job-control.html