FrancescoDiMuro Posted March 18, 2019 Share Posted March 18, 2019 (edited) @Chaym You could use WMI object or _WinAPI_GetProcessMemoryInfo(). Here it is an example: #include <Array.au3> #include <AutoItConstants.au3> #include <WinAPI.au3> Global $arrProcessList, _ $arrProcessStats, _ $arrProcessMemoryInfo, _ $objWMI, _ $objWMIQueryResult $objWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2") $arrProcessList = ProcessList("") For $i = 1 To $arrProcessList[0][0] Step 1 $objWMIQueryResult = $objWMI.ExecQuery("SELECT WorkingSetSize, PeakWorkingSetSize FROM Win32_Process WHERE ProcessId = " & $arrProcessList[$i][1]) $arrProcessStats = ProcessGetStats($arrProcessList[$i][1], $PROCESS_STATS_MEMORY) $arrProcessMemoryInfo = _WinAPI_GetProcessMemoryInfo($arrProcessList[$i][1]) For $objWMIResult In $objWMIQueryResult ConsoleWrite("ProcessName : " & $arrProcessList[$i][0] & @CRLF & _ "ProcessId : " & $arrProcessList[$i][1] & @CRLF & _ "WorkingSetSize" & @CRLF & _ " o WMI : " & $objWMIResult.WorkingSetSize & @CRLF & _ " o ProcessGetStats() : " & $arrProcessStats[0] & @CRLF & _ " o _WinAPI_GetProcessMemoryInfo: " & $arrProcessMemoryInfo[2] & @CRLF& _ "PeakWorkingSetSize" & @CRLF & _ " o WMI : " & $objWMIResult.PeakWorkingSetSize * 1024 & @CRLF & _ " o ProcessGetStats() : " & $arrProcessStats[1] & @CRLF & _ " o _WinAPI_GetProcessMemoryInfo: " & $arrProcessMemoryInfo[1] & @CRLF & @CRLF) Next Next $objWMI = 0 Edited March 18, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Chaym Posted March 19, 2019 Author Share Posted March 19, 2019 My mistake. Changing Log On Account did not help... Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 19, 2019 Share Posted March 19, 2019 @Chaym Did you try the other ways to obtain those information? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Chaym Posted March 19, 2019 Author Share Posted March 19, 2019 I am not that experienced to do that. I've noticed that I get this error only with process that is also a service. I'll try your example. Thank you. Link to comment Share on other sites More sharing options...
Chaym Posted March 19, 2019 Author Share Posted March 19, 2019 FrancescoDiMuro It is not working. It fails in line: $arrProcessStats = ProcessGetStats($arrProcessList[$i][1], $PROCESS_STATS_MEMORY) Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 19, 2019 Share Posted March 19, 2019 @Chaym Remove all the lines in which there is that array (that in your case is not working), and try with the other two arrays Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Developers Jos Posted March 19, 2019 Developers Share Posted March 19, 2019 I am wondering why we think it will work with another tool while it really looks like a authorization issue ..... or am I missing something? Jos FrancescoDiMuro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Chaym Posted March 19, 2019 Author Share Posted March 19, 2019 (edited) I think you are right Jos. I mapped all the processes that are not passing ProcessGetStats(ProcessName) to see what authorization is missing. I'm looking at Process properties in task manger, in TAB 'Security' to see if can find the problem It seems that all the processes that are not passing ProcessGetStats are also services.... Edited March 19, 2019 by Chaym 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