June 19th, 2012, 10:31 AM
Getting VBscript to work with ajax?
I'm having problems passing a vbscript variable through ajax. Is that even possible? Is there a workaround for something like below? My idea is to grab the computer name via vbs and send it as a form to another webpage to process it. This is being housed in a jsp page.
The main issue is that while the computer name is saved to the variable msg, I don't know how to get that variable working in the second part:
It of course, just sends msg rather than the computer name.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
msg = objOperatingSystem.Caption
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST", "http://localhost:8080/IQCS/SelfService/test/rectest.jsp", False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Set objHTTP = Nothing
June 19th, 2012, 12:25 PM
objHTTP.send "field1=" & msg
Comments on this post
“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss
June 19th, 2012, 12:51 PM
Thanks man, works great!
Originally Posted by medialint