- May
- 13,834
- 211
I have a script which gives the start times of a few services and processes. It's meant to be called when the monitor is turned on (1) or off (0).
Without POWERMONITOR it works OK.
@WMI fails when I run the script as POWERMONITOR's command.
Without POWERMONITOR it works OK.
Code:
v:\> monitoron.btm 0
Monitor OFF: 2024-11-03 16:00:09.352
v:\> monitoron.btm 1
Monitor ON: 2024-11-03 16:00:11.344
AppXSvc started: 2024-11-03 15:56:30.121
WaaSMedicSvc started: 2024-10-31 00:50:43.538
RuntimeBroker started: 2024-11-03 15:56:30.077
@WMI fails when I run the script as POWERMONITOR's command.
Code:
v:\> powermonitor Display forever `v:\monitoron.btm %_powerdisplay`
Monitor ON: 2024-11-03 16:01:24.155
Error : Failed to create instance of WbemStatusCodeText
TCC: (Sys) V:\monitoron.btm [12] Incorrect function.
"%@wmi[.,"select creationdate from Win32_process where processid=7908"]"
Error : Failed to create instance of WbemStatusCodeText
TCC: (Sys) V:\monitoron.btm [15] Incorrect function.
"%@wmi[.,"select creationdate from Win32_process where processid=0"]"
Error : Failed to create instance of WbemStatusCodeText
TCC: (Sys) V:\monitoron.btm [20] Incorrect function.
"%@wmi[.,"select creationdate from Win32_process where processid=5060"]"