Guidance
指路人
g.yi.org
Software / Reginald / Examples / repository / Desktop Management / Basic Computer Information / Power.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* Displays power management and status information */
strcomputer = "."
objwmiservice = getobject("winmgmts:\\" || strcomputer || "\root\CIMV2")
colitems = objwmiservice~execquery("SELECT * FROM Win32_ComputerSystem")
DO objitem OVER colitems
	IF objitem~powermanagementcapabilities \== "" THEN SAY objitem~powermanagementcapabilities
	SAY "PowerManagementSupported:" objitem~powermanagementsupported
	SELECT objitem~powerstate
		WHEN 1 THEN strpowerstate = "Full Power"
		WHEN 2 THEN strpowerstate = "Power Save - Low Power Mode"
		WHEN 3 THEN strpowerstate = "Power Save - Standby"
		WHEN 4 THEN strpowerstate = "Power Save - Unknown"
		WHEN 5 THEN strpowerstate = "Power Cycle"
		WHEN 6 THEN strpowerstate = "Power Off"
		WHEN 7 THEN strpowerstate = "Power Save - Warning"
		OTHERWISE strpowerstate = "Unknown"
	END
	SAY "PowerState:" strpowerstate
	SELECT objitem~powersupplystate
		WHEN 1 THEN strpowersupplystate = "Other"
		WHEN 3 THEN strpowersupplystate = "Safe"
		WHEN 4 THEN strpowersupplystate = "Warning"
		WHEN 5 THEN strpowersupplystate = "Critical"
		WHEN 6 THEN strpowersupplystate = "Non-recoverable"
		OTHERWISE strpowersupplystate = "Unknown"
	END
	SAY "PowerSupplyState:" strpowersupplystate
END
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2022-8-10  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:49:16