Professional Web Applications Themes

Win32::Process Kill Process in Windows ME - PERL Modules

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...

  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. #2

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


    "Stefan Mueller" <s1210197yahoo.de> wrote in message
    news:f35b4d73.0504122349.79560db0posting.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

  3. #3

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

    Hello Rob,

    Thank you for your answer.

    "Sisyphus" <sisyphus1nomail.afraid.org> wrote in message news:<425ce4a5$0$29868$afc38c87news.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

  4. #4

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


    "Stefan Mueller" <s1210197yahoo.de> wrote in message
    news:f35b4d73.0504142300.553dc396posting.google.c om...
    > Hello Rob,
    >
    > Thank you for your answer.
    >
    > "Sisyphus" <sisyphus1nomail.afraid.org> wrote in message
    news:<425ce4a5$0$29868$afc38c87news.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 doented 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

Similar Threads

  1. Replies: 6
    Last Post: May 17th, 07:08 PM
  2. How? Granting elevated privileges to a web service / kill a process
    By Lee Gillie in forum ASP.NET Web Services
    Replies: 1
    Last Post: May 13th, 12:48 PM
  3. Q: Win32::Process::Info
    By Reinhard Pagitsch in forum PERL Modules
    Replies: 0
    Last Post: June 16th, 07:33 AM
  4. can't kill child process - program hangs up
    By Shawn Corey in forum PERL Miscellaneous
    Replies: 0
    Last Post: July 26th, 02:03 PM
  5. Kill process
    By Oleg in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 2nd, 08:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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