WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: Garry on May 02, 2022, 02:44:47 PM

Title: problem with error 213: processlist=tlistproc0
Post by: Garry on May 02, 2022, 02:44:47 PM
This is part of my scripts that fail with error code:213

I assume it is the wwprc44i.dll causing the problem.

Note the copy below has all the lines commented out to make the rest of the script run ok.

It's just a thing I put in wbt scripts to run winbatch at high priority.

Here's the part of the scripts that cause the error:

;;;SET WINBATCH TO HIGH PRIORITY
;AddExtender("WWPRC44I.DLL")
;Processlist=tListProc()
;lookfor="Winbatch"
;ptr=StrIndexNC(processlist,lookfor,0,@FWDSCAN)
;If ptr==0
;   Message(lookfor,"Not found")
;   Exit
;EndIf
;ptr=StrIndex(processlist,"|",ptr,@FWDSCAN)
;ptr2=StrIndex(processlist,@TAB,ptr,@FWDSCAN)
;If ptr2==0;if last item in list
;   pid=StrSub(processlist,ptr+1,-1)
;Else
;   pid=StrSub(processlist,ptr+1,ptr2-ptr-1)
;EndIf
;;;Message(lookfor,pid)
;ret = tSetPriority(pid,128);set to high priority

How can I fix this problem?
Title: Re: problem with error 213: processlist=tlistproc0
Post by: td on May 02, 2022, 03:10:04 PM
The problem could have one of three possible causes:
1. The calling process (WinBatch) does not have read access to the HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\perflib\009 virtual registry key.
2. Performance counting might be disabled on the machine executing the script.
3. Performance counters are corrupt.

Three is the most common problem and can often be fixed by executing the "lodctr /R" command from an elevated command prompt.

You can check for disabled performance counters by looking for the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\PerfProc\Performance["Disable Performance Counters"] value.

Permission issues can be settled by executing the script from an account with the proper permissions like an admin account if necessary.
Title: Re: problem with error 213: processlist=tlistproc0
Post by: Garry on May 04, 2022, 03:04:57 PM
Since I didn't see anything in the registry called "Disable Performance Counters" I tried the lodctr /R command as an administrator and it worked.

I only re-enable the section of code in one of my winbatch scripts and it works now so I'll have to try the other scripts containing the same code.

Usually just rebooting would solve the problem but I guess this time the counters were completely gone.

The lodctr /R command said it rebuilt the counter from a recovery file/system.
Title: Re: problem with error 213: processlist=tlistproc0
Post by: td on May 05, 2022, 07:22:34 AM
As mentioned previously corrupt performance counters are the most common cause of your problem. The corruption is usually the result of a buggy performance counter extension installed by some 3rd party application or a WMI application fiddling with the registry according to our friends at MSFT.