If you’re an admin and manually checking logs for details and opening each file one by one. Then opening multiple instances of notepad is quite an everyday task. Or you just love notepad in making notes, documentations or other endless reasons to use notepad. Then it will be a headache in closing all the notepad instances that were opened. However, PowerShell can be used to close all instances of notepad all at once. No sweat in clicking each file one by one. PowerShell can handle it in one click of a button if you open the file via PowerShell ISE. Here’s a simple PowerShell code snippet to close all files in one shot. #========== $x = ( Get-Process | Where-Object { $_ . ProcessName -EQ 'Notepad' }) . count 1 .. $x | % { stop-process -name notepad –force } #=========== Yes, 2 lines of code can save you a lot of time. The above code can be used also to close other processes that has multiple instances open on the system. If uns...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.