I'm trying to create a gadget that uses some WMI calls to retrieve "cooked" perf data from the WMI counters. Although the code used to work in RC1 w/o any problem, in RTM the same counter classes seem to need Admin privileges.
Is there a way that a gadget can have admin privs for running

Elevating privileges for WMI calls in a sidebar
fmuser
RichLeyshon
Here is some code that requires elevated priviliges to run. I basically need to run this code witihn a gadget and can't do so unless it's elevated.
Set objCimv2 = GetObject("winmgmts:root\cimv2")
Set objRefresher = CreateObject("WbemScripting.SwbemRefresher")
Set objNW = objRefresher.AddEnum(objCimv2, "Win32_PerfFormattedData_Tcpip_NetworkInterface").ObjectSet
' Initial refresh needed to get baseline values
objRefresher.Refresh
For each nw in objNW
Wscript.Echo nw.Name
Next
Wscript.Sleep 10000
objRefresher.Refresh
Andreas Asterlund
You might want to read User Account Control and WMI which goes into detail about what you can/can't do with WMI when UAC is concerned.
There must be another way to get the info you require though, as ipconfig and Task Manager both do it without being elevated. Depending on what you're after, you can probably get it though wsock32.dll or icmp.dll
fscarpa58
Basically I'm trying to get the number of bytes sent and recieved on a particular network connection on an ongoing basis. Is there another way I can do that
Llorean