View Single Post
  #3 (permalink)  
Old 02-09-2008
Julian
 

Posts: n/a
Re: Change Process Base Priority?
Haven't tried it yet but can see no reason to doubt it! Perfect! Thank you
very much...

Not only a statement of principle but a worked example - A+ answer!!

Don't suppose you know how to resolve the "Access denied" error when
attempting to start the Windows Event Log Service (which failed to start on
its own) do you...>

Thanks!

--
Julian I-Do-Stuff

Some Vista stuff, but mostly just Stuff at http://berossus,blogspot.com
"JohnBuk [MSFT]" <johnbuk@online.microsoft.com> wrote in message
news:7B844419-030E-4BAE-83AE-5743FC8B4EE5@microsoft.com...
> Yes, save the following snippit as startnormal.vbs. Change out NORMAL
> with
> ABOVE_NORMAL to test with calc.exe.
>
> --
> ' Title: Start a Process with a Base Priority
> ' References:
> http://www.microsoft.com/technet/scr....mspx?mfr=true
> '
> ' Instructions: Change strProcessName to the name of the executable
>
> Const strProcessName = "calc.exe"
>
> Const NORMAL = 32
> Const BELOW_NORMAL = 16384
> Const ABOVE_NORMAL = 32768
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> Set objStartup = objWMIService.Get("Win32_ProcessStartup")
> Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
>
> Set objConfig = objStartup.SpawnInstance_
> objConfig.PriorityClass = NORMAL
>
> errReturn = objProcess.Create(strProcessName, null, objConfig,
> intProcessID)
> --
>
> John
>
> --
> Speaking for myself only.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> --
>
>
> "Julian" wrote:
>
>> [Vista HP]
>> With Windows task Manager "Run As Administrator" one can change the base
>> priority of a process...
>>
>> I have one application that starts with "Below Normal" priority, which is
>> a
>> pain in the neck when the virus scanner is active; manually changing the
>> priority to Normal restores acceptable performance
>>
>> Q: Is there any way (batch file, registry edit, other) to automatically
>> set
>> the Base Priority at application startup?
>>
>> TIA
>>
>> Julian
>> --
>> Julian I-Do-Stuff
>>
>> Some Vista stuff, but mostly just Stuff at http://berossus,blogspot.com
>>
>>


Reply With Quote