Win32::Process Kill Process in Windows ME

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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. ...
    2. 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...
    3. 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...
    4. 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 ){ ...
    5. 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...
  3. #2

    Default Re: Win32::Process Kill Process in Windows ME


    "Stefan Mueller" <s1210197@yahoo.de> wrote in message
    news:f35b4d73.0504122349.79560db0@posting.google.c om...
    > 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.
    >
    What actually happens ? Does the script hang .... or exit silently .... or
    ..... ?
    Do you get any warnings or error messages ?

    use warnings;
    > Win32::Process::Create($ProcessObj,
    > "C:\\Program Files\\Internet
    > Explorer\\iexplorer.exe",
    > "iexplore temp.txt",
    > 0,
    > NORMAL_PRIORITY_CLASS,
    > ".")|| die ErrorReport();
    >
    Not sure. Maybe (untested):

    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

  4. #3

    Default 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>...
    > What actually happens ? Does the script hang .... or exit silently .... or
    > .... ?
    > 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.
    > use warnings;
    no warnings
    > Not sure. Maybe (untested):
    >
    > my $exitcode;
    > my $pid = $ProcessObj->GetProcessID();
    > Win32::Process::KillProcess($pid, $exitcode);
    > # $exitcode is set to the exitcode of the process.
    it's the same. What's about the exitcode? I have used 1 and 9, but
    there is no difference.

    Cheers,
    Stefan
    Stefan Mueller Guest

  5. #4

    Default Re: Win32::Process Kill Process in Windows ME


    "Stefan Mueller" <s1210197@yahoo.de> wrote in message
    news:f35b4d73.0504142300.553dc396@posting.google.c om...
    > Hello Rob,
    >
    > Thank you for your answer.
    >
    > "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
    news:<425ce4a5$0$29868$afc38c87@news.optusnet.com. au>...
    > > What actually happens ? Does the script hang .... or exit silently ....
    or
    > > .... ?
    > > 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.
    >
    I can't find any documented reason for the problem (and I don't actually
    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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139