Ask a Question related to PERL Modules, Design and Development.
-
Stefan Mueller #1
Win32::Process Kill Process in Windows ME
Hello,
I want to kill a Process in Windows ME, which I have started. I have
executed the following lines in XP and it works. I execute this in ME,
the process starts but it won't be killed.
Win32::Process::Create($ProcessObj,
"C:\\Program Files\\Internet
Explorer\\iexplorer.exe",
"iexplore temp.txt",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
$ProcessObj->Kill(1);
Is there a possibility to kill processes in Windows ME?
Thanks in advance.
Stefan
Stefan Mueller Guest
-
Win32::Process, SetProcessAffinityMask for an existing process =perl crash
Hi! Was planning to use Win32::Process to set the ProcessAffinityMask of some processes but this lead to pure and simple crash of perl.exe. ... -
How? Granting elevated privileges to a web service / kill a process
I need to be able to kill a process programmatically under ASP.NET. IIS runs under the local system account. The user accessing the web is using... -
Q: Win32::Process::Info
Hello, Does anyone have experience with this Modul? How can I make it work to get the CPU-Usage in % for a specific process ID? Or is there an... -
can't kill child process - program hangs up
Hi, I didn't know fork worked in M$ DOS. Try: if( undefined( $pid = fork())){ print "Can't fork\n"; exit; }elsif( $pid ){ ... -
Kill process
Hello everyone. I'm trying to kill process on selected SPIDs only. Select works, killing doesn't. It complains on syntax near 'kill'. Please... -
Sisyphus #2
Re: Win32::Process Kill Process in Windows ME
"Stefan Mueller" <s1210197@yahoo.de> wrote in message
news:f35b4d73.0504122349.79560db0@posting.google.c om...What actually happens ? Does the script hang .... or exit silently .... or> Hello,
>
> I want to kill a Process in Windows ME, which I have started. I have
> executed the following lines in XP and it works. I execute this in ME,
> the process starts but it won't be killed.
>
..... ?
Do you get any warnings or error messages ?
use warnings;
Not sure. Maybe (untested):> Win32::Process::Create($ProcessObj,
> "C:\\Program Files\\Internet
> Explorer\\iexplorer.exe",
> "iexplore temp.txt",
> 0,
> NORMAL_PRIORITY_CLASS,
> ".")|| die ErrorReport();
>
my $exitcode;
my $pid = $ProcessObj->GetProcessID();
Win32::Process::KillProcess($pid, $exitcode);
# $exitcode is set to the exitcode of the process.
Cheers,
Rob
--
To reply by email send to optusnet.com.au instead of nomail.afraid.org
Sisyphus Guest
-
Stefan Mueller #3
Re: Win32::Process Kill Process in Windows ME
Hello Rob,
Thank you for your answer.
"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message news:<425ce4a5$0$29868$afc38c87@news.optusnet.com. au>...No, I get no error messages. The script doesn't hang, it exists like> What actually happens ? Does the script hang .... or exit silently .... or
> .... ?
> Do you get any warnings or error messages ?
the way on XP.
no warnings> use warnings;
it's the same. What's about the exitcode? I have used 1 and 9, but> Not sure. Maybe (untested):
>
> my $exitcode;
> my $pid = $ProcessObj->GetProcessID();
> Win32::Process::KillProcess($pid, $exitcode);
> # $exitcode is set to the exitcode of the process.
there is no difference.
Cheers,
Stefan
Stefan Mueller Guest
-
Sisyphus #4
Re: Win32::Process Kill Process in Windows ME
"Stefan Mueller" <s1210197@yahoo.de> wrote in message
news:f35b4d73.0504142300.553dc396@posting.google.c om...news:<425ce4a5$0$29868$afc38c87@news.optusnet.com. au>...> Hello Rob,
>
> Thank you for your answer.
>
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in messageor> > What actually happens ? Does the script hang .... or exit silently ....I can't find any documented reason for the problem (and I don't actually>> > .... ?
> > Do you get any warnings or error messages ?
> No, I get no error messages. The script doesn't hang, it exists like
> the way on XP.
>
have a Windows ME to experiment with). KillProcess() calls OpenProcess() and
TerminateProcess(). I've checked the msdn docs for both OpenProcess and
TerminateProcess and there's no mention of any special considerations
regarding Windows ME.
If you want (and assuming you can compile Win32::Process from source) you
could try changing (in Process.xs):
HANDLE ph = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
to:
HANDLE ph = OpenProcess(PROCESS_TERMINATE, 0, pid);
(You'll find that about 5 or 6 lines from the end of the file.) I can't
really think of any reason that should help, however.
ActiveState now hosts a (low volume) libwin32-perl mailing list. Maybe
someone there can help. See:
[url]http://aspn.activestate.com/ASPN/Mail/[/url]
Cheers,
Rob
Sisyphus Guest



Reply With Quote

