Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - webpage scan client programs

Reply
 
Old 03-11-2009   #1 (permalink)
techstress


 
 

webpage scan client programs

We're trying implement a script on our web site that retreives the
Java Runtime version and redirects the user based on the version
number. I've made a script that works as a vbs. However, when I try
to implement it as a webpage, the script stops without showing any
error.

I realize that there might be a security issue here, but would think
that the visitor could click through the yellow bar.

Is there anything I can do to get the html page to work?

vbs script

strProd = "Java(TM) 6"
strQry = "SELECT Version FROM Win32_Product WHERE Name LIKE '%" &
strProd & "%'"

Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
'Set colItems = objWMIService.ExecQuery( strQry, "WQL", 48 )
Set colItems = objWMIService.ExecQuery( strQry)

For Each objItem In colItems
txt = txt & "Name: " & objitem.name & vbcrlf & "Version: " &
objItem.Version &_
vbcrlf & vbcrlf
Next

msgbox txt

..
..
..

html page


<script language="vbscript">
strProd = "Java(TM) 6"
strQry = "SELECT Version FROM Win32_Product WHERE Name LIKE '%" &
strProd & "%'"
document.write("start <br>")


Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
'Set colItems = objWMIService.ExecQuery( strQry, "WQL", 48 )

Set colItems = objWMIService.ExecQuery( strQry)

'for each objitem in GetObject( "winmgmts://localhost").Instancesof
("Win32_Product")

For Each objItem In colItems
txt = txt & "Name: " & objitem.name & vbcrlf & "Version: " &
objItem.Version &_
vbcrlf & vbcrlf
Next

document.write(txt)
document.write("end")
'msgbox txt
</script>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Webpage Shortcuts & Custom Icons for "All Programs" in Vista Vista General
Lost Good Lexmark Scan software to Inferior Vista Scan Vista print fax & scan
Webpage email link won't open -- error message -- default email client not installed Vista mail
Canon FB620U - Office 2007 Scan OK - Vista F & Scan NO ? Vista print fax & scan
using windows fax and scan client and Windows fax server Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46