Re: lower down the priority of the process automatically
From: Gerry Thomas (gfthomas_at_sympatico.ca)
Date: 04/15/04
- Next message: Feed_me_spam: "Re: why segfault for large ifc-compiled executable?"
- Previous message: Gerry Thomas: "Re: Uninitialized variables"
- Maybe in reply to: Chien-hui Liu: "lower down the priority of the process automatically"
- Next in thread: E P Chandler: "Re: lower down the priority of the process automatically"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 15 Apr 2004 17:42:20 -0400
"Jon" <jon_d_r@msn.com> wrote in message
news:9b0216bc.0404150644.1f09062c@posting.google.com...
> "Gerry Thomas" <gfthomas@sympatico.ca> wrote in message
news:<Gcofc.23254$vF3.1493942@news20.bellglobal.com>...
> > "Jon" <jon_d_r@msn.com> wrote in message
> > news:9b0216bc.0404141132.57a862e0@posting.google.com...
> > > chliu@tit.edu.tw (Chien-hui Liu) wrote in message
> > news:<5e084a37.0404140632.773d5e48@posting.google.com>...
> > > > Hi,
> > > >
> > > > I write a batch file, which includes several commands as follows:
> > > > a.exe<a1.inp
> > > > a.exe<a2.inp
> > > > ..
> > > > And this batch file needs to run for almost a month.
> > > > I have to press "Ctrl-Alt-Del" and lower down the priority of the
> > > > process every time, then I can do another works I have to do
currently
> > > > important. Or else, the computer goes very slow. I use MS-windows
> > > > 2000.
> > > > Is there any way to automatically lower down the processes ? Like
> > > >
> > > > <lower_down_process_command> a.exe<a1.inp
> > > > <lower_down_process_command> a.exe<a2.inp
> > > > ...
> > > >
> > > > Thank you very much
> > > >
> > > > C. H. Liu
> > >
> > > One way you can do this is to use Windows Management Instrumentation
> > > (WMI) scripting. Check out Microsoft's websites about WMI Scripting.
> > > Using this, you can do something like this to accomplish what you
want
> > > to invoke "YOURPROGRAM.exe":
> > >
> > > Const LOW = 64
> > > strComputer = "."
> > > Set objWMIService = GetObject("winmgmts:" _
> > > & "{impersonationLevel=impersonate}!\\" & strComputer &
> > > "\root\cimv2")
> > > Set objStartup = objWMIService.Get("Win32_ProcessStartup")
> > > Set objConfig = objStartup.SpawnInstance_
> > > objConfig.PriorityClass = LOW
> > > Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
> > > objProcess.Create "YOURPROGRAM.exe", Null, objConfig, intProcessID
> >
> > That's as clear as glass but recall that this is c.l.f., haunt of the
> > Windows-be-damned-Fortran-for-Xbox (sic Portability 'R Us) coterie in
> > emulation of the saved and worthwhile at www.landoverbaptist.org/.
Anyway,
> > assuming you're on good terms with the Johnny Fever - type in the glass
> > cage you can do each other a turn by installing the latest PrcView from
> > www.prcview.com, which allows you to set the job's priority to whatever
and
> > more.
> >
> > Skip's Windows-centric suggestion is smarter in the sense that if life
were
> > to be found on Mars, and were one to ask it to guess how to schedule a
job
> > on a generic processor, and if instead of excuses, derision, and
pedantry
> > it were to come up with START, RUN, LOAD, and the like, one would
conclude
> > that it possessed some redeeming value without costing a nickel.
>
> Skip's solution is the one I'd choose (except that I usually use the Task
Manager).
>
> I thought the Windows Scripting code would bring a chuckle or two.
It's amazing how once you've seen WMI script you see it, or rather you
think you see it, all over the place. Must check out the F2003 CD to see if
there's any of it lurking therein.
I had a word with my Johnny Fever guy (SysOP) earlier today who brought
this C# WMI app to my attention:
http://www.codeproject.com/csharp/wmi.asp?target=wmi
He tells me that WMI is favored in .NET over dealing directly with the API.
It looks interesting.
-- E&OE Ciao, Gerry T. ______ "God is not willing to do everything and thereby take away our free will and that share of glory that rightfully belongs to us." -- Machiavelli.
- Next message: Feed_me_spam: "Re: why segfault for large ifc-compiled executable?"
- Previous message: Gerry Thomas: "Re: Uninitialized variables"
- Maybe in reply to: Chien-hui Liu: "lower down the priority of the process automatically"
- Next in thread: E P Chandler: "Re: lower down the priority of the process automatically"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|