Kill a process Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Fefint
Posts: 28
Joined: 18 Aug 2017, 09:27

Kill a process

23 Sep 2018, 01:12

So I'm trying to kill googleupdate.exe, but I'm not really sure why I can't seems ti kill it. This is what I have,

Code: Select all

if not A_IsAdmin{
	Run *RunAs "%A_ScriptFullPath%"
	ExitApp
}

Process Exist, GoogleUpdate.exe
PID := ErrorLevel
MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, PID = %PID%
Process, Close, GoogleUpdate.exe
Process, Close, %PID%
Process, Close, 4364
exitapp 
The PID is correct according to procexp64, and I can kill it in task manager. So I'm not sure why it dosn't work.
buttshark
Posts: 62
Joined: 22 Apr 2017, 20:57

Re: Kill a process

23 Sep 2018, 02:59

I've never used Process before, so I can't tell you why it isn't working. Have you tried using WinClose instead?

Code: Select all

WinClose, ahk_pid %PID%
I have no idea what I'm doing.
Fefint
Posts: 28
Joined: 18 Aug 2017, 09:27

Re: Kill a process

23 Sep 2018, 03:41

Did not work.
garry
Posts: 3795
Joined: 22 Dec 2013, 12:50

Re: Kill a process  Topic is solved

23 Sep 2018, 07:31

in Windows-10 it exist a program taskkill.exe

Code: Select all

;- see taskkill help :
run,%comspec% /k taskkill /?
return
Fefint
Posts: 28
Joined: 18 Aug 2017, 09:27

Re: Kill a process

23 Sep 2018, 08:40

run,%comspec% /k taskkill /F /IM GoogleUpdate.exe && exit
return

Killed the Process.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: Kill a process

23 Sep 2018, 08:51

Code: Select all

if (!A_IsAdmin)
{
    MsgBox "You must run the script as Administrator."
    ExitApp
} I := 0
DllCall("Ntdll.dll\RtlAdjustPrivilege", "UInt", 20, "UChar", TRUE, "UChar", FALSE, "UPtrP", I)

; Your code

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: MrDoge, peter_ahk and 360 guests