DIY简易CPU,内存脚本

简介: Name         CPU(p) ----         ------ _Total          100 Idle            100 Skype            12 dwm               6 SnagitEditor      6  ...

 

Name         CPU(p) ----         ------

_Total          100

Idle            100

Skype            12

dwm               6

SnagitEditor      6

 

Name                 CPU(s) ----                 ------

Skype           7000.578125

Thunder          3189.84375

ThunderPlatform     1346.25

firefox          951.921875

explorer          646.46875

 

FreePhysicalMemory ------------------            

859072

 

~~~~~~~~~~~

No matter how much money you have invested in a new computer, sooner or later you will face performance problems.

These problems are usually related with the CPU or the memory. Computers are becoming so complex that you need all the help you can get to find the source of the problems.

The first thing I do when I notice that my computer is not acting as it should is run Task Manager. With this tool you can easily see the usage of Memory and CPU of every process on your computer. I always do the same: look for the processes that are using more CPU and see if there are enough physical memory available.

So, why not have a utility that do the same with just one click and that can be easily found in your Windows 7 Taskbar?

To do this we are going to use one component of Windows 7, PowerShell, that can be also used in other Windows versions.

 

PowerShell is an enhancement of VBScript, which is no more than a scripting language.

Even if you don’t understand what a scripting language is, you can just read this post and you will have your utility running for free in no time.

The information this utility is going to display is the following:

Check Memory CPU Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

The first list is of every process that is using more than 0 percent of your CPU. This list is sorted by the CPU usage at the moment it’s run. In this case the _Total and the Idle process are not real processes; however, WmiPrvSE is a real process which is using 3% CPU.

The second list displays the 5 running processes that have used more CPU Time. This is measured in seconds. If the computer is running slowly since startup, this is the list you need to check.

The last list is the free physical memory. This cannot be seen as a definitive measure to know the reason for a poor performance but it can be a sign.

Create the Script

So, first we are going to create a folder that is going to have the script that displays the information. I have used c:\utils.

You are going to create a new file in that folder, CheckMemoryCpu.bat in c:\utils.

To do this, open notepad, press WinKey + R, type notepad, and press Enter.

windows 7 Notepad Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Copy the following text to that file.

@echo off
Powershell -command "&{Get-WmiObject -Query 'Select * from Win32_PerfFormattedData_PerfProc_Process '| Select Name, @{Name='CPU(p)';Expression={$_.PercentProcessorTime}} |  where {$_.'CPU(p)' -gt 0 } |Sort 'CPU(p)' -descending | Format-Table -AutoSize;}" Powershell -command "&{Get-Process | Select Name, @{Name='CPU(s)';Expression={$_.CPU}} | sort 'CPU(s)' -Descending | Select -First 5| Format-Table -AutoSize;}" Powershell -noexit -command "&{Get-WmiObject -Query 'Select * from Win32_OperatingSystem' | Select FreePhysicalMemory | Format-Table -AutoSize;}"

It’s not the intention of the article to explain every part of this script.

Windows 7 Notepad CheckMemoryCPU Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Save it as c:\utils\CheckMemoryCPU.bat:

Windows 7 CUtilsCheckMemoryCPU Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

If you don’t use the hyphens it will create a text file, with the txt extension.

Relax, take a breath. You have done the more complicated part. Now we are going to pin the utility to the Windows 7 Taskbar.

Pin the Script to the Taskbar

We cannot pin the recent created file to the Taskbar directly, therefore we have to use a trick.

To do this we create a new shortcut.

Right click on a folder or over the Desktop and select New > Shortcut.

Windows 7 New Shorcut Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Type cmd /c  c:\utils\CheckMemoryCPU.bat and click Next.

Windows 7 Create Shortcut Cmdcutilscheckmemorycpur Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Windows asks for a name, I have used CheckMemoryCPU but you can use other if you prefer. Click Finish.

To change the icon right click over the shortcut and click Properties.

Click Change Icon.

Windows 7 ShorCut ChangeICon Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Windows has several files full of very detailed icons. One I like is located in c:\windows\system32\imageres.dll.

Once you find the file you can use the icon you prefer.

Windows 7 Icon Chip Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

Now that you have your shortcut created you only have to move to the Taskbar.

Windows 7 Pin ShortCut To Taskbar Monitor CPU and Memory Usage with Just One Click in Windows 7 [How To]

And this is it. Just click it for a quick glance and what is slowing down your PC.

目录
相关文章
|
25天前
|
JSON Java Serverless
nacos常见问题之cpu和内存占用高如何解决
Nacos是阿里云开源的服务发现和配置管理平台,用于构建动态微服务应用架构;本汇总针对Nacos在实际应用中用户常遇到的问题进行了归纳和解答,旨在帮助开发者和运维人员高效解决使用Nacos时的各类疑难杂症。
139 0
|
2月前
|
弹性计算
2024阿里云幻兽帕鲁/Palworld服务器价格表(CPU/内存/带宽/磁盘收费标准)
2024年阿里云幻兽帕鲁专用服务器的价格根据不同的配置有所不同。 • 4核16G配置的价格为32元/月,如果选择购买3个月,则价格为96元。 • 8核32G配置的价格为90元/月,如果选择购买3个月,则价格为271元。 另外,还有配置为4核16G10M带宽的服务器,其价格为26元/月起。而8核32G10M带宽的价格也是90元/月。
93 1
|
17天前
|
存储 监控 异构计算
【Python】GPU内存监控脚本
【Python】GPU内存监控脚本
|
18天前
|
存储 缓存 PHP
阿里云服务器实例、CPU内存、带宽、操作系统选择参考
对于使用阿里云服务器的用户来说,云服务器的选择和使用非常重要,如果实例、内存、CPU、带宽等配置选择错误,可能会影响到自己业务在云服务器上的计算性能及后期运营状况,本文为大家介绍一下阿里云服务器实例、CPU内存、带宽、操作系统的选择注意事项,以供参考。
阿里云服务器实例、CPU内存、带宽、操作系统选择参考
|
1月前
|
弹性计算 固态存储 Linux
2024年阿里云服务器租用详细价格表(CPU/内存/带宽/系统盘)
2024阿里云服务器租用优惠价格表,轻量服务器2核2G3M带宽轻量服务器一年61元,2核4G4M带宽轻量服务器一年165元12个月,ECS云服务器e系列2核2G配置、3M固定带宽、40G ESSD Entry云盘,99元一年、2核4G服务器30元3个月、2核4G配置365元一年、2核8G配置522元一年,云服务器u1、云服务器c7、g7和r7优惠价格表,CPU内存带宽系统盘配置详细报价:
731 3
|
1月前
|
弹性计算 固态存储 调度
阿里云服务器部署配置选择全攻略,ECS实例规格、CPU内存配置
阿里云服务器部署配置选择全攻略,ECS实例规格、CPU内存配置,CPU内存、公网带宽和系统盘怎么选择?个人用户选择轻量应用服务器或ECS通用算力型u1云服务器,企业用户选择ECS计算型c7、通用型g7云服务器,阿里云百科分享阿里云服务器配置选择方法
|
1月前
|
弹性计算 固态存储 调度
阿里云服务器选购指南_2024新版CPU内存带宽系统盘选择攻略
阿里云服务器选购指南_2024新版CPU内存带宽系统盘选择攻略,CPU内存、公网带宽和系统盘怎么选择?个人用户选择轻量应用服务器或ECS通用算力型u1云服务器,企业用户选择ECS计算型c7、通用型g7云服务器,阿里云百科分享阿里云服务器配置选择方法
|
1月前
|
弹性计算 固态存储 调度
阿里云配置服务器详细指南_2024新版CPU内存带宽系统盘选择
阿里云配置服务器详细指南_2024新版CPU内存带宽系统盘选择,阿里云服务器配置怎么选择?CPU内存、公网带宽和系统盘怎么选择?个人用户选择轻量应用服务器或ECS通用算力型u1云服务器,企业用户选择ECS计算型c7、通用型g7云服务器,阿里云百科分享阿里云服务器配置选择方法
|
2月前
|
弹性计算 大数据 测试技术
阿里服务器租用多少钱一年?阿里云服务器租用价格表(最新CPU/内存/带宽/磁盘收费标准)
阿里服务器租用多少钱一年?阿里云服务器租用价格表(最新CPU/内存/带宽/磁盘收费标准)。阿里云服务器的租用费用因实例类型、地域、配置等因素而有所不同,价格范围可以从几百元到几千元不等。2024年阿里云服务器租用费用价格表更新,云服务器ECS经济型e实例2核2G、3M固定带宽99元一年、ECS u1实例2核4G、5M固定带宽、80G ESSD Entry盘优惠价格199元一年,轻量应用服务器2核2G3M带宽轻量服务器一年61元、2核4G4M带宽轻量服务器一年165元12个月、2核4G服务器30元3个月,幻兽帕鲁4核16G和8核32G服务器配置,云服务器ECS可以选择经济型e实例、通用算力u1实
|
2月前
|
弹性计算 大数据 测试技术
2024阿里云服务器租用价格表(CPU/内存/带宽/磁盘收费标准)
阿里云服务器分为轻量应用服务器和云服务器ECS,轻量适合个人开发者使用,搭建轻量级的网站、测试环境使用;专业级如大数据、科学计算、高并发网站等需要使用云服务器ECS。2024年阿里云服务器租用价格表出炉!云服务器ECS经济型e实例2核2G、3M固定带宽99元一年、ECS u1实例2核4G、5M固定带宽、80G ESSD Entry盘优惠价格199元一年,轻量应用服务器2核2G3M带宽轻量服务器一年61元、2核4G4M带宽轻量服务器一年165元12个月、2核4G服务器30元3个月,幻兽帕鲁4核16G和8核32G服务器配置,云服务器ECS可以选择经济型e实例、通用算力u1实例、ECS计算型c7、通
457 1

热门文章

最新文章