Skip to content

Instantly share code, notes, and snippets.

@xcloudx01
Created June 6, 2017 04:21
Show Gist options
  • Save xcloudx01/64930edef9d2745e54c4f8d390ecc8b2 to your computer and use it in GitHub Desktop.
Save xcloudx01/64930edef9d2745e54c4f8d390ecc8b2 to your computer and use it in GitHub Desktop.
AHK - Dump list of all running processes + monitor
;Prerun
#singleinstance force
;Main
Loop
{
GetRunningProcesses()
sleep,2000
}
;Functions
GetRunningProcesses()
{
for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
{
ProcessName := process.Name
ProcessCommand := process.CommandLine
if (ProcessName = "System Idle Process" or ProcessName = "System" or ProcessName = "wininit.exe" or ProcessName = "winlogon.exe" or ProcessName = "lsass.exe" or ProcessName = "services.exe") ;Always ignore list.
continue
else
{
IniWrite,%ProcessCommand%,ProcessLog.txt,KnownProcesses,%ProcessName%
}
}
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment