470,810 Members | 886 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

LOST - Win32::Process

Hi all,

I am new and am lost with Win32::Process stuff.

I want on perl script to start a process, then another perl script to
terminate the same process.

I can start a process using...
use Win32::Process;
use Win32;
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
"notepad temp.txt",
".")|| die ErrorReport();
I can search for that process using...
use Win32::Process::Info;
$pi = Win32::Process::Info->new();
@pids = $pi->ListPids (); # Get all known PIDs
@info = $pi->GetProcInfo (); # Get the max
%subs = $pi->Subprocesses (); # Figure out subprocess relationships.
for $pid (@info){
print "-----------------------\n";
print $pid->{"Name"}."\n";
print $pid->{"CreationDate"}."\n";
print $pid->{"ExecutablePath"}."\n";
print $pid->{"KernelModeTime"}."\n";
print $pid->{"MaximumWorkingSetSize"}."\n";
print $pid->{"MinimumWorkingSetSize"}."\n";
print $pid->{"ProcessId"}."\n";
print $pid->{"UserModeTime"}."\n";

if ("$pid->{\"Name\"}" eq "notepad.exe") {
$gotit = $pid->{"ProcessId"};
print("Found notepad.exe with pid $gotit\n");
So what is the next step to actually terminate it?

Thanks in advance :)
Jul 19 '05 #1
1 4801
terminate = kill

Sep 5 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Guy | last post: by
reply views Thread by Carlo Filippini | last post: by
1 post views Thread by rob | last post: by
2 posts views Thread by Paolo | last post: by
1 post views Thread by Java and Swing | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.