Setting priority for a service with Automatic StartupType

N

Noam Lerner

I'm looking for a way to make sure a service always starts with high priority. Let's say the process is `MyService`.I have a setup where I'm building a Windows image. As part of the image building process, I call `Start-Service`, and then I follow up with `Set-Service -Name MyService -StartupType 'Automatic'`Looking at various references, I found that a possible solution would be to search for the service, and then set the priority. Something like: Get-WmiObject Win32_process -filter 'name = "MyService.exe"' | foreach-object { $_.SetPriority(128) }My issue is what happens if the system reboots

Continue reading...
 
Back
Top Bottom