What is the problem with Task Manager ?
You can simply check this by going to Task Manager and Resource Monitor. But when your computer goes slow, even the task manager takes a lot of time to load and more over, it also takes some physical memory as it shows a lot of real time CPU graphs. So you may not want to open the task manager during this critical time. So I am going to tell you what to do in such situations.
How to do this?
Just copy and paste the following code in a notepad and save it in .vbs extenision. For example I will suggest you to save it as task.vbs
n = 5It will quickly show you the top 5 processes which are consuming most of your physical memory.No need to open any Task Manager or Resource monitor.
Set objWMI = GetObject("winmgmts:\.rootcimv2")
Set colObjects = objWMI.ExecQuery("Select * From Win32_Process")
Dim usage1(9999)
Dim name1(9999)
Dim size
Dim finalMes
For Each Item In colObjects
size = size + 1
usage1(size) = Item.WorkingSetSize
name1(size) = Item.name
Next
For i = 1 To size
For j = i + 1 To size
If (Int(usage1(i)) < Int(usage1(j))) Then
temp1 = usage1(j)
usage1(j) = usage1(i)
usage1(i) = temp1
temp2 = name1(j)
name1(j) = name1(i)
name1(i) = temp2
End If
Next
Next
finalMes = "Top " + CStr(n) + " Memory Consuming Processes" + vbCrLf + vbCrLf
For i = 1 To n
finalMes = finalMes + name1(i) + " ---> " + CStr(usage1(i) / 1024) + " KB" + vbCrLf
Next
MsgBox finalMes, vbOKOnly, "On " + CStr(Date) + " At " + CStr(Time)
Can I see top 10 processes in the list ?
Yes, definitely you can. Just look in to the VB code you can find n=5 in the first line. Just change it to n=10 to see top 10 processes in the list. As simple as it is.