...

View Full Version : Output vbscript and WMI in HTML



Amanda Wansley
04-19-2004, 03:40 PM
undefinedundefinedundefined

I am an intern with the task of writting an interface for a hardware database.
I have to take some code my supervisor wrote and try to output it in HTML, but in a way that it can be edited after it is output. Here is the code. My problem is getting the html to recognize the vbscript procedure. Is it a good idea to make it a procedure? :eek: :confused: Does any have any suggestions? I need help bad.

<HTML>
<BODY>
<HEAD>
<TITLE>onemore</TITLE>

<script language="vbscript">

Sub_cmdButton onClick()

Dim Name As String
Dim Model As String


Model = strmsg & "Model: " & objItem.Model CRLF
Name = strmsg & "Name: " & objItem.Name


'strComputer = "."
strComputer = InputBox("Please enter the name of the computer[insert a period '.']
for the current machine")
If strComputer = "" Then
wscript (0)
End If

Set objWMIService = GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")


'Win32_ComputerSystem
Set colItems = objWMIService.ExecQuery('Select * from
Win32_ComputerSystem",,48)


For Each ObjItem in colItems
Memformat = Cint(objItem.TotalPhysicalMemory/1000000)
</script>

</HEAD>

<BODY onload = "cmdButton()">

<script langauge = "javascript">

document.write(Name)
document.write(Model)

</scrip>
</BODY>

</HTML>

black3842
04-22-2004, 05:31 AM
I responded to your duplicate post here:
http://www.codingforums.com/showthread.php?t=37167



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum