I use vbscript and my code is that:
strComputer = "127.0.0.1" ' Leave User and Password blank for local machine strUser = "" strPassword = "" strNamespace = "root/cimv2" Set objLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objLocator.ConnectServer(strComputer,strNamespace,strUser,strPassword) Set objTimeZone = objWMIService.ExecQuery ("SELECT * FROM Win32_TimeZone") For Each colTimeZone in objTimeZone strBias = colTimeZone.Bias strStandardname = colTimeZone.Standardname Next wscript.echo "<?xml version=""1.0"" encoding=""UTF-8"" ?>" wscript.echo "<prtg>" wscript.echo "<result>" wscript.echo "<channle>" & strBias & "</channel>" wscript.echo "<value>test123</value>" wscript.echo "</result>" wscript.echo "<result>" wscript.echo "<channle>" & strStandardname & "</channel>" wscript.echo "<value>test234</value>" wscript.echo "</result></prtg>" wscript.quit("0")
but it return error, the error message is
"Response not wellformed: "(<?xml version="1.0" encoding="UTF-8" ?> <prtg> <result> <channle>-480</channel> <value>test123</value> </result> <result> <channle>Pacific Standard Time</channel> <value>test234</value> </result></prtg> )" (code: PE132)" |
what wrong with my code?
Add comment