- Weekly Tip Home
- Change Recycle Bin settings in Windows 7
- Windows 7 Features - All Editions
- Prevent Windows Update from automatic reboot
- How to Configure a User Account to Automatically Log On ?
- How to change start button icon in Windows 7 ?
- Disable the Windows Startup Sound.
- Windows Sysinternals Suite for Windows 7
- Turn on/off Windows Features
- Windows 7 Calculator Keyboard Shortcuts
- Change Windows 7 Numbers, Measurements and date Format
- Windows key shortcuts for Windows 7
- Open Windows 7 folder with Shell command
- A List of Run Commands For Windows 7
- Find Windows 7 Problem Reports history on Your PC
- Make Internet Explorer 8 Load Faster
- Windows Explorer Keyboard Shortcuts for Windows 7
- Learning About Your Own Account with Whoami in Windows 7
- Automatically Delete Temporary Files using batch script in Windows 7
- Save Hard disk Space by disabling memory dump files in Windows 7
- Make Windows 7 Shut down Faster
- Increase Windows 7 PC Memory (RAM) with your Flash drive
- Understanding Disk Management Terminology in Windows7
- All about VHD (Virtual Hard Disk) in Windows 7
- Administer your Windows7 PC using Microsoft Management Console (MMC)
- Types of Stop Error on Windows 7 PC
- Enable the hidden Administrator account in Windows 7
- Managing Installed Drivers in Windows 7 PC
- Cracking Hardware Errors in Windows 7 PC
- Command-Line (CMD) Editing Keys in Windwos 7
- Display Empty Removable Drives
- List of inbuilt applications you would like to replace in Windows 7
- Enable GodMode Feature on Windows 7
- Make your Windows 7 talk
- Make folder and content within undeleteable and only accessible to yourself in Windows 7
- Hidden Utilities and Shortcuts in Windows 7
- Create keyboard shortcuts to your favourtie application in Windows 7
- Show additional time zone in your Windows 7 taskbar
- Auto Login to your Windows 7 PC
- Install Telnet with only one command in Windows 7
- Open Command Prompt From Any Folder in Windows 7
- Automate Powershell script to find high processes running on Windows 7 PC
- Check RAM issues with Windows Memory Diagnostic tool in Windows 7
- Show your downloads on Windows 7 start Menu
- Unlock new themes in Windows 7 PC
- Use Windows 7 Without Activation
- Turn off Autoplay Feature in Windows 7 with one Click
- Running Disk Defragmenter from command line in Windows 7
Automate Powershell script to find high processes running on Windows 7 PC
When your computer runs slow there's always chance something is chewing up your memory. If you check your task manager, you can see application and memory use as below

Here at Computer Anthem we will show you how to write powershell script to find the application that is chewing your memory, we will also show you how you can automate this script to run every 1 hour. Follow below steps to write, run and automate the script.
Write and Run the script Steps
Step I - Make sure you can run Powershell Script on your Windows 7 PC, if you haven't run powershell script on your PC before, by default it is set to restricted, Click here to follow our tutorial to set it to unrestricted
Step II - Once you have set your Powershell to run the script, copy below script and paste it to your notepad
$a = get-process | where-object {$_.WorkingSet -gt 60000000}
$a | out-gridview
Note: You can change gt value (gt 60000000) above to value of your choice.
Step III - Save your script as XXX.PS1 , save it somewhere to your C: or other drive, for this tutorial i have created folder call Scripts on my F: drive and saved the script on F:\Scripts .
Note: XXX = Name of your choice.
Step IV - Now you need to create a batch file to automate the script, copy below script and paste it to your notepad
powershell.exe -noexit F:\Scripts\XXX.ps1
Note: F:\Scripts\XXX.ps1 is the location and name of your powershell script which you created before.
Step V - Save your script as XXX.CMD, save it to same location where you previously saved your Powershell script (XXX.ps1).

Step VI - Double click on Just created cmd file to make sure your script is working, if you see output as below than your script is running, else there is something wrong with your script or cmd file, make sure you follow above steps carefully to make it work.

Step VII - You have now successfully created running powershell script and cmd file, now you can automate this to run every 1 hour (or any interval of your choice).
Automate the Script Steps
Step VIII - Go to start and in the search field type task scheduler and than Click on task scheduler.

Step IX - Click on Create Basic Task as shown below

Step X - Give a name and description to your task and click on Next as shown below

Step XI - Tick on radio button Daily and Click on Next as shown below

Step XII - Give a start date to your task and click on Next as shown below

Step XIII - Tick on radio button Start a program and click on Next.

Step XIV - Browse to the location where you previously saved your xxx.CMD (xxx.bat) on step V above and click on Next as shown below

Step XV - Tick the box " Open the properties dialog for this task when i click finish " and click on Finish as shown below

Step XVI - Make sure you change configure for to "Windows 7, Windows Server 2008 R2 " as shown below

Step XVII - Click on triggers tab and click on Edit as shown below

Step XVIII - Tick the box "Repeat task every" and change value to 1 hour (you can also type the value to any hour) and click on drop down and change for a duration of to Indefinitely.

Step IX - Click on OK as shown below

You have now successfully automated the script to run every hour, you will see below screen every hour with number of application chewing up your memory, close both the screen for your script to run again.

- 08/12/2011 05:12 - Running Disk Defragmenter from command line in Windows 7
- 24/07/2011 09:38 - Turn off Autoplay Feature in Windows 7 with one Click
- 17/07/2011 06:31 - Use Windows 7 Without Activation
- 10/07/2011 06:08 - Unlock new themes in Windows 7 PC
- 03/07/2011 23:43 - Show your downloads on Windows 7 start Menu
- 27/06/2011 03:20 - Check RAM issues with Windows Memory Diagnostic tool in Windows 7
- 12/06/2011 09:32 - Open Command Prompt From Any Folder in Windows 7
- 05/06/2011 01:28 - Install Telnet with only one command in Windows 7
- 30/05/2011 03:46 - Auto Login to your Windows 7 PC
- 22/05/2011 06:14 - Show additional time zone in your Windows 7 taskbar
- 15/05/2011 07:32 - Create keyboard shortcuts to your favourtie application in Windows 7
- 08/05/2011 11:24 - Hidden Utilities and Shortcuts in Windows 7
- 01/05/2011 12:38 - Make folder and content within undeleteable and only accessible to yourself in Windows 7
Last Updated (Sunday, 19 June 2011 12:46)
Back







Comments