You can use WMI for that. I am not exactly sure that the values of the following property can be interpreted as indicator of "idleness" - it just shows the average amount of time the processor spent outside the idle thread lately:
set proc = GetObject("winmgmts:").InstancesOf ("Win32_PerfFormattedData_PerfOS_Processor")
for each p in proc
WScript.Echo p.PercentProcessorTime
next
I am also unsure of what the individual members of that collection are: I have 2 logical processors and the collection for my system consists of 3 elements, so one of those elements either represents an average on two processors or the value for the physical processor, or something else. Perhaps, a simple average of all elements will do:
function IsIdle()
dim total, count, procs, average
set procs = GetObject("winmgmts:").InstancesOf("Win32_PerfFormattedData_PerfOS_Processor")
total = 0
count = 0
for each proc in procs
total = total + proc.PercentProcessorTime
count = count + 1
next
average = total/count
if average < 5 then
IsIdle = vbTrue
else
IsIdle = vbFalse
end if
end function