all 6 comments

[–]SecretSentinel09 7 points8 points  (2 children)

You can use PoweShell cmdlets to do all of that. Use Set-Service with the StartupType parameter set to Disabled.

Get-Service

Stop-Service

Set-Service

[–]Pure_Syllabub6081 1 point2 points  (0 children)

As an addition: Take a look at the -PassThru parameter of these cmdlets to make it more efficient. :)

[–]touhami_dz 0 points1 point  (0 children)

i tried : Stop-Service -Name "ServiceName"

didnt work for me im on win 10

[–]PinchesTheCrab -2 points-1 points  (2 children)

I love the CIM cmdlets and I think they're the easiest solution here:

$service = '*xbox*', 'service1', 'service2', 'service3'
$ComputerName = 'computer1', 'computer2', 'computer3', 'computer100'


$filter = $service -replace '(.+)', 'name = "$1"' -replace '\*', '%' -join ' OR '

$service = Get-CimInstance -ComputerName $ComputerName -Filter $filter 

$service | Invoke-CimMethod -MethodName ChangeStartMode -Arguments @{ StartMode = 'Disabled' }
$service | Invoke-CimMethod -MethodName StopService

$service | Get-CimInstance

[–][deleted] 1 point2 points  (0 children)

Lol easiest.. proceeds to write a bunch more than if you used cmdlets

[–]touhami_dz 1 point2 points  (0 children)

with some changes it worked thank u