Jump to content
Sign in to follow this  
Xanthus

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

Recommended Posts

Xanthus

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

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
Xanthus

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

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
Xanthus

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

Share this post


Link to post
Share on other sites
FireFox

@Xanthus

If you know process name, why are you using WinGetProcess ?

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
Xanthus

oops double post

Edited by Xanthus

Share this post


Link to post
Share on other sites
Xanthus

@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")

Share this post


Link to post
Share on other sites
FireFox

@Xanthus

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

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
LarryDalooza

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.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
Xanthus

@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

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
Xanthus

Have you tried:

ProcessClose("Diablo II")
Does not work :) I really appreciate your help.

I might go back to xp, vista is kinda annoying :lmao:

Share this post


Link to post
Share on other sites
Pain

Are you using ZoneAlarm?....

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
Xanthus

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

Share this post


Link to post
Share on other sites
Xanthus

One thing, killing Notepad.exe for example does work!

Share this post


Link to post
Share on other sites
Pain

Also when Diablo is running?

Share this post


Link to post
Share on other sites
Xanthus

Resolved! My autoit version was a little bit outdated... It works now!

Thanks for helping me everyone!

Share this post


Link to post
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
Sign in to follow this  

×