I have a situation where I actually _do_ want the command window to
show after a runtime.exec() call. (Although we pipe stout/stdin to
our own logging mech, the program needs to be able to trap Ctrl-C
keystrokes). Our application is launched by javaw.
In Java 1.3.1, this behaviour was present (and much resented it looks
like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer
pops up on a Runtime.exec("o urbatchfilelaun cher.bat") I tried doing
an exec("cmd launcher.bat") but no joy there either.
Is there any way of turning this behaviour back on? Thanks in
advance,
James. 2 2959
James Goldwater wrote: I have a situation where I actually _do_ want the command window to show after a runtime.exec() call. (Although we pipe stout/stdin to our own logging mech, the program needs to be able to trap Ctrl-C keystrokes). Our application is launched by javaw.
In Java 1.3.1, this behaviour was present (and much resented it looks like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer pops up on a Runtime.exec("o urbatchfilelaun cher.bat") I tried doing an exec("cmd launcher.bat") but no joy there either.
Is there any way of turning this behaviour back on? Thanks in advance,
James,
I wouldn't look for a solution to turn the behavior back on in Java.
That will likely be fruitless.
I would explore using different options to cmd (like /c) and also
explore using the start command (go to Windows help for details). You
might need to have multiple BAT files calling each with the start
command, etc.
Let me know how it works out.
HTH,
Ray
--
XML is the programmer's duct tape.
You could try with the '/c' option, this has worked very well for
me....
You could also read this
( http://www.javaworld.com/javaworld/j...29-traps.html). It
will give you some details about Runtime Execution in Java.....
Quiks.
--------------
BTW: For those who have to do with monitoring, check the site: http://www.metamindsolutions.com. It's a great multiplatform
monitoring solution and seems to have been adopted by large accounts ja***@eccehomo. co.uk (James Goldwater) wrote in message news:<3e******* *************** ****@posting.go ogle.com>... I have a situation where I actually _do_ want the command window to show after a runtime.exec() call. (Although we pipe stout/stdin to our own logging mech, the program needs to be able to trap Ctrl-C keystrokes). Our application is launched by javaw.
In Java 1.3.1, this behaviour was present (and much resented it looks like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer pops up on a Runtime.exec("o urbatchfilelaun cher.bat") I tried doing an exec("cmd launcher.bat") but no joy there either.
Is there any way of turning this behaviour back on? Thanks in advance,
James. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: JW |
last post by:
Hi,
I don't seem to get any results from the following use
of Runtime.getRuntime().exec(cmd) using Java 1.4 on
Redhat linux.
Suppose that in the same directory as my java file below,
I have files junk1, junk2, junk3, and i want
to have the java program delete all of these files.
|
by: BlackHawke |
last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses
two programs- one to play the game, another to patch the game as updates
come out. Players actually launch the updater which checks for fresh
updates, then installs them, then launches the game client.
We have begun our beta test, and would like to have the client open with a
console window so that players can see exceptions that are thrown. How to do
this seems to...
|
by: somebody |
last post by:
I'm trying to change a users password on a Linux system
by spawning a process. Here's what the command looks
like on the command line:
echo 'myuser:mypasswd' | chpasswd
It uses a pipe, which I think may be causing the poblem.
Here's the java code to execute the above command, which
doesn't work. I've tried it with and without single
quotes, and numerous other permutations, to no avail.
|
by: uwnewsgroup |
last post by:
When I was using Runtime.exec(String cmd) to run a unix utility (join), and
try to
get its standard output by using Process.getOutputStream(), it blocks
forever. I tried
it using Java 1.4 and the results are the same on SunOS 5.8, Redhat8.0,
cygwin.
I read relevant articles and find the reason is that the output of the
process exceeds the
buffer allocated for that process. So can I adjust the buffer size (on any
|
by: Good Man |
last post by:
Hi there
I am trying to execute a custom-built java program on my linux server via
PHP. Basically, a user uploads files via PHP, and then the java program
performs some action on these files.
I have successfully had other operations performed on these files by
using backticks, ie:
$doit = `my exec command`;
| |
by: piradie |
last post by:
Hello,
I've been googling around, and looking into different webpages but couldn't find a clear response for the issue I need to resolve, so I was hoping any of you could give me an answer to my problem.
Well, I'm trying to make a simple program that would open a cmd window and types a desired command. I've come across this:
String command = "command you would like to get executed";
Runtime.getRuntime().exec(command);
...
|
by: swethak |
last post by:
Hi,
i have a command to convert the video file into image
ffmpeg -i sample.wmv -f image2 -t 0.001 -ss 3 ss.jpg
i run that one in command prompt it converted the video file into image.
But i executed that command in jsp Program .It didn't work.It shows error.
|
by: sayeo87 |
last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got:
<%@ page import="java.io.*" %>
<HTML>
<BODY>
<%
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("/bin/ls");
|
by: Shayco |
last post by:
hey,
in my code i'm using Runtime.getRuntime().exec() in order to run a .bat file that calls another java program (they communicate with each other using RMI).
when i call:
Process process = Runtime.getRuntime().exec("cmd /c start C:\\MyFolder\\JavaApp.bat");
the seperate process runs perfectly, but when i add a space to the path:
Process process = Runtime.getRuntime().exec("cmd /c start \"C:\\My Folder\\JavaApp.bat\"");
then the java.exe...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |