🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #409

Re: Help on Process.destroy(),......why it doesn't work.

#409
From: David Huang
Date: Sat, 22 Nov 2003 08:21
43 lines
1848 bytes
Hi all,
I found the reason is like this:
I using
> Process process = rt.exec("explorer");
but at win2k explorer can not be killed by this way. If I changed to
iexplorer it will work.

Thanks
David

"David Huang" <dayicool@sina.com> д���ʼ�
news:3fbec8a7$1@newsgroups.borland.com...
> hi all,
>
> I have a program that does Runtime.exec(a bat/sh script file), which will
> start a java process.
>
> When I tried to destroy this process using process.destroy(), it does not
> work.
>
> Can some one help me ..?
>
> my code looks like this:
>
>
>
> Runtime rt = Runtime.getRunTime();
>
> Process process = rt.exec(MyScriptFile);
>
> try{
>
>     Thread.sleep(5000);   //just waiting for process started by my script
> file to initialize
>
> }catch(Exception ex){}
>
> process.destroy();
>
> Thanks
> David
>
>
Technical Details
Message-ID: <3fbf1cf8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fbec8a7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,76f0d7b0ceca596d
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-11-22 00:39:03 PST
From: "David Huang" <dayicool@sina.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3fbec8a7$1@newsgroups.borland.com>
Subject: Re: Help on Process.destroy(),......why it doesn't work.
Date: Sat, 22 Nov 2003 16:21:59 +0800
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 218.5.84.96
Message-ID: <3fbf1cf8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069489400 218.5.84.96 (22 Nov 2003 00:23:20 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail