I would like to sum used memory of all programs named "test.exe" in a batch script. I can use the following command to get memory usage of all the appropriate processes:
C:> wmic process where name="test.exe" get workingsetsize | findstr /v "WorkingSetSize"
55758848
66174976
So, I guess I would like to sum all those values together with a FOR loop. The following command would just display the i variable, but nevertheless I get the appended error.
C:> for /F %i IN ( wmic process where name="test.exe" get workingsetsize ^| findstr /v "WorkingSetSize" ) DO echo %i
test.exe - Invalid alias verb.
How can I change that command to sum all the used memory together and output it and it must work in the CMD, preferably very similar to my command.
Thanks