User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,436 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,279 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1959 | Replies: 3
Reply
Join Date: Apr 2005
Posts: 21
Reputation: luisator is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
luisator luisator is offline Offline
Newbie Poster

Help stopping an application execution

  #1  
Jul 5th, 2005
HI everybody! I am starting a visual basic application from java with the following routine:

Runtime rt = Runtime.getRuntime();
try {
Process p = rt.exec("Grabacion");

}
catch (Exception e)
{ e.printStackTrace();
}
I want to know if there is any method in java that can make this application "grabacion" stop running...like a stop or quit exec or something like that! Hope someone can help me very soon!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: stopping an application execution

  #2  
Jul 5th, 2005
try the destroy() method.
Reply With Quote  
Join Date: Apr 2005
Posts: 21
Reputation: luisator is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
luisator luisator is offline Offline
Newbie Poster

Help Re: stopping an application execution

  #3  
Jul 5th, 2005
I tried the destroy method but that one forces the application to close. My application is developed in Visual Basic, and if I use the destroy method the aplication doesnt reach the unload metho so I dont get the expected results. I need something like closing the window or something like that, is it possible??? Help me please, is the last step of my graduation project!!!!!
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: stopping an application execution

  #4  
Jul 5th, 2005
I've looked up the class api and can only find one other possible method that will help: exitValue()

It returns the exit value for the subprocess, but I don't know what you could do with that.

Now, one other way to kill the process is to call the kill.exe file on your computer(if you have windows).

Runtime.getRuntime().exec("kill fileID"), where fileIDis the Process Id. You'll probably have trouble finding the process ID, so I don't know about that either.


Overall, I think this is a problem with your VB code not handling the exit right, or else you're just out of luck.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 2:39 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC