PC Review


Reply
Thread Tools Rate Thread

Change Process Base Priority?

 
 
Julian
Guest
Posts: n/a
 
      6th Feb 2008
[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
 
 
 
 
JohnBuk [MSFT]
Guest
Posts: n/a
 
      9th Feb 2008
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
 
Julian
Guest
Posts: n/a
 
      9th Feb 2008
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]" <(E-Mail Removed)> wrote in message
news:7B844419-030E-4BAE-83AE-(E-Mail Removed)...
> 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
 
JohnBuk [MSFT]
Guest
Posts: n/a
 
      9th Feb 2008
The usual suspects are the registry settings or the file permissions.
You could use Process Monitor and see if you find an status Access Denieds
in it why trying to start the service.

http://technet.microsoft.com/en-us/s.../bb896645.aspx

You could also check the permissions on the files themselves.
Start a command prompt as administrator and repeat for each evtx file.

cd %SystemRoot%\System32\Winevt\Logs
cacls system.evtx

If it doesn't look like this, then it's been modified from the default.

C:\Windows\System32\winevt\Logs\System.evtx
NT SERVICE\EventlogID)F
NT AUTHORITY\SYSTEMID)F
BUILTIN\AdministratorsID)F

However, there could be other files locations that are in correct as well
like.
C:\Windows\ServiceProfiles\LocalService\AppData\Local


If the permissions are incorrect, you could change it back manually or use
the command in this KB article.

How to reset security settings back to the defaults
http://support.microsoft.com/kb/313222

Good Luck,

John
--
Speaking for myself only.
This posting is provided "AS IS" with no warranties, and confers no rights.
--


"Julian" wrote:

> 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]" <(E-Mail Removed)> wrote in message
> news:7B844419-030E-4BAE-83AE-(E-Mail Removed)...
> > 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
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permanently change process priority? Jack Windows XP General 2 4th Feb 2010 04:02 PM
Permanently change process priority? Jack Windows XP Help 1 4th Feb 2010 11:13 AM
Change Process Priority John Microsoft Excel Programming 0 14th Oct 2005 10:29 AM
2 dos apps slow until NTVDM priority lowered - can i set process priority automatically at startup ? scott Microsoft Windows 2000 6 17th Mar 2005 04:42 PM
Process priority change not showing up in Windows Task Manager =?Utf-8?B?Tm9ybQ==?= Microsoft Dot NET 1 24th Nov 2004 07:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:47 AM.