Xanthus Posted January 14, 2009 Share Posted January 14, 2009 (edited) 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)What am I doing wrong?Thanks in advance! Edited January 15, 2009 by Xanthus Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) 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 :SThanks for your reply though! Edited January 14, 2009 by Xanthus Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 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 More sharing options...
FireFox Posted January 14, 2009 Share Posted January 14, 2009 @Xanthus If you know process name, why are you using WinGetProcess ? Cheers, FireFox. Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) oops double post Edited January 14, 2009 by Xanthus Link to comment Share on other sites More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 @Xanthus If you know process name, why are you using WinGetProcess ? Cheers, FireFox. Good question, I'm not sure but this doesn't work either! #RequireAdmin WinClose("Game.exe") Link to comment Share on other sites More sharing options...
FireFox Posted January 14, 2009 Share Posted January 14, 2009 @Xanthus ?? Can you explain what you want and answer to my question please ? Cheers, FireFox. Link to comment Share on other sites More sharing options...
LarryDalooza Posted January 14, 2009 Share Posted January 14, 2009 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. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) @Xanthus ?? Can you explain what you want and answer to my question please ? 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 >>>> 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 January 14, 2009 by Xanthus Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 Have you tried: ProcessClose("Diablo II")Does not work I really appreciate your help. I might go back to xp, vista is kinda annoying Link to comment Share on other sites More sharing options...
Pain Posted January 14, 2009 Share Posted January 14, 2009 Are you using ZoneAlarm?.... Link to comment Share on other sites More sharing options...
SpookMeister Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 (edited) 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 January 14, 2009 by Xanthus Link to comment Share on other sites More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 One thing, killing Notepad.exe for example does work! Link to comment Share on other sites More sharing options...
Pain Posted January 14, 2009 Share Posted January 14, 2009 Also when Diablo is running? Link to comment Share on other sites More sharing options...
Xanthus Posted January 14, 2009 Author Share Posted January 14, 2009 Resolved! My autoit version was a little bit outdated... It works now! Thanks for helping me everyone! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now