Jump to content

Vista ProcessClose does not work[RESOLVED: outdated autoit version]


Xanthus
 Share

Recommended Posts

This doesn't close the process...

#RequireAdmin
$rofl = WinGetProcess("game.exe")
ProcessClose($rofl)

Some info:

The process "game.exe" is running under my user.

And I started "game.exe" as administrator. (right click --> properties --> compatibility --> run as administrator)

Posted Image

What am I doing wrong?

Thanks in advance!

Edited by Xanthus
Link to comment
Share on other sites

Let me start off by saying I do not have Vista to test with...

I did notice however that you are trying to kill "game.exe" but Task Manager appears to be running "Game.exe"... dunno if that makes a difference or not.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Let me start off by saying I do not have Vista to test with...

I did notice however that you are trying to kill "game.exe" but Task Manager appears to be running "Game.exe"... dunno if that makes a difference or not.

Tried with a capital and same result :S

Thanks for your reply though!

Edited by Xanthus
Link to comment
Share on other sites

Have you verified that you are actually getting the process?

$rofl = WinGetProcess("game.exe")
if $rofl = -1 then 
   msgbox(0,"Error:","Could not get process")
else
   msgbox(0,"PID:","PID=" & $rofl)
endif
ProcessClose($rofl)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Have you verified that you are actually getting the process?

$rofl = WinGetProcess("game.exe")
if $rofl = -1 then 
   msgbox(0,"Error:","Could not get process")
else
   msgbox(0,"PID:","PID=" & $rofl)
endif
ProcessClose($rofl)
Could not get process :S
Link to comment
Share on other sites

Try using the "AutoIt Window Info" tool to see what it shows. Bet you need a better name to properly call the function.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

@Xanthus

:) ?? Can you explain what you want and answer to my question please ? :lmao:

Cheers, FireFox.

I'm currently using WinKill to kill the window, but sometimes the process keeps running. So I would like to get rid of the process...

You are logged in as "Jochem"?

run a ProcessList and get the infor into a msgbox or something to see what you can see.

Lar.

I'm logged in as Jochem yes

I ran this:

; List all processes
$list = ProcessList()
for $i = 1 to $list[0][0]
  msgbox(0, $list[$i][0], $list[$i][1])
next

and it gives "2752" as Process ID for "Game.exe"

Try using the "AutoIt Window Info" tool to see what it shows. Bet you need a better name to properly call the function.

I'm trying to kill the process, not the window, but here's the summary of what you've asked for :think:

>>>> Window <<<<
Title:  Diablo II
Class:  Diablo II
Position:   317, 259
Size:   806, 626
Style:  0x14C00000
ExStyle:    0x00040100
Handle: 0x00E905EC

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 0x010908CC

>>>> Mouse <<<<
Position:   325, 322
Cursor ID:  15
Color:  0x7C7470

>>>> StatusBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<
Edited by Xanthus
Link to comment
Share on other sites

Have you tried:

ProcessClose("Diablo II")

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Try this:

#include <array.au3>
$list = ProcessList()
_ArrayDisplay($list)
$pid = InputBox("Kill Process", "Enter the PID of the process to kill:")
If @error Then
    Exit
Else
    ProcessClose($pid)
EndIf

Run it, note the PID of game.exe then close the window, enter the PID you noted earlier in the input box and click OK, then see if it kills the game.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Are you using ZoneAlarm?....

no comodo firewall, but it's disabled.

Try this:

#include <array.au3>
$list = ProcessList()
_ArrayDisplay($list)
$pid = InputBox("Kill Process", "Enter the PID of the process to kill:")
If @error Then
    Exit
Else
    ProcessClose($pid)
EndIf

Run it, note the PID of game.exe then close the window, enter the PID you noted earlier in the input box and click OK, then see if it kills the game.

Did it and it doesnt kill, I'll try uninstalling comodo firewall tomorrow and bump the topic, thanks for the help! Edited by Xanthus
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...