Product, version and build: Powershell Studio, 5.6.158.0
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64bit
Hello,
i modify the attached script to get all running process on my Windows 10 machine.
What i want is: When i click on "Load View" button, generate the list of all process running. After i checked the process that i want to kill and i click on "Kill Process" button to kill it.
How can i do it? Anyone can help me?
Thanks!
Marco
Checkbox Question
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Checkbox Question
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Checkbox Question
Have you looked at the "Spotlight" article for the control?
Right click on the "ListView" control in the toolbox for the documentation and support articles. They will explain with examples, how to use a ListView. Most controls have useful articles on the right-click menu (context menu).
Right click on the "ListView" control in the toolbox for the documentation and support articles. They will explain with examples, how to use a ListView. Most controls have useful articles on the right-click menu (context menu).
Re: Checkbox Question
Ok, i'll take a look!jvierra wrote: ↑Tue Feb 12, 2019 3:11 pm Have you looked at the "Spotlight" article for the control?
Right click on the "ListView" control in the toolbox for the documentation and support articles. They will explain with examples, how to use a ListView. Most controls have useful articles on the right-click menu (context menu).
Thanks!
Re: Checkbox Question
I looked at Spotlight but it didn't help, may someone can help me
I attached the modified script Now when i click the button and at least one checkbox is checked, returns a message.
What i want is: After i press the button, every checkbox is checked execute "Stop-Process -Name $ProcessName".
Thanks!
I attached the modified script Now when i click the button and at least one checkbox is checked, returns a message.
What i want is: After i press the button, every checkbox is checked execute "Stop-Process -Name $ProcessName".
Thanks!
Re: Checkbox Question
OK, i modified a little bit.
Will be very helpful if you can write a little example, i'm stuck right now.
Thanks!
- $buttonLoadView_Click={
- $Process = Get-Process
- foreach($proc in $Process)
- {
- Add-ListViewItem -ListView $listview1 -Items $proc.ProcessName
- }
- }
Thanks!
Re: Checkbox Question
Code: Select all
$buttonStopProcess_Click={
$listview1.CheckedItems |
ForEach-Object{
Write-Host ("Item checked " + $_.Text)
#Stop-Process $_.Text
}
}
Re: Checkbox Question
Not what was wrong. You need to look at my code above. You also need to re-read the spotlight and MSDN articles on how to use a ListView.
Re: Checkbox Question
Now i understand where i'm wrong!jvierra wrote: ↑Thu Feb 14, 2019 12:31 pmCode: Select all
$buttonStopProcess_Click={ $listview1.CheckedItems | ForEach-Object{ Write-Host ("Item checked " + $_.Text) #Stop-Process $_.Text } }
I have a lot of things to study, thanks for your help!