Amanda Wansley
04-19-2004, 05:02 PM
undefinedundefinedundefined
:confused: I am an intern with the task of writting some software for a hardware database. I need to output some WMI into an HTML file, then be able to edit it after it is output.Here is the code I am using. How do I do that? I really need help!
strComputer = "."
strComputer = InputBox("Please enter the name of the computer [insert a period '.'] for the current machine")
If strComputer = "" Then
wscript(0)
End If
CRLF = Chr(13) & Chr(10) ' carriage return, line feed
strmsg = ""
filename = ""
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)
strmsg=strmsg & "Manufacturer: " & objItem.Manufacturer & CRLF
strmsg=strmsg & "Model: " & objItem.Model & CRLF
strmsg=strmsg & "Name: " & objItem.Name & CRLF
' strmsg=strmsg & "Total Memory: " & objItem.TotalPhysicalMemory & CRLF
strmsg=strmsg & "Memory (MB): " & Memformat & CRLF
filename =filename & objItem.Name
Next
I'm looking to output information about the current machine that the program is running on. i.e. Model, Memory, Mac address. etc. Then once the program has pulled this info up into a webpage, we want to be able to massage the data (edit it) then send it to a database. You would ideally use ASP for this, but right now we do not have the resources to do that, so we're trying to find a short term solution to the problem, so we won't have to key in the data. Which as you know results in finger slips, and curruption of the data.
We have alot of new hardware coming in, and really no defined database. So the long term goal is to use what we learn doing this little chunk right here, and then try to expand the idea.
I first thought to make the code above a sub procedure, then call it from javascript, maybe a document.write or span. But I really have no clue. The main thing I am having trouble with is getting the outputted info in to an Html file, and in a way that it can then be edited. But not copy and pasted. I don't know if this helps you or not.
:confused: I am an intern with the task of writting some software for a hardware database. I need to output some WMI into an HTML file, then be able to edit it after it is output.Here is the code I am using. How do I do that? I really need help!
strComputer = "."
strComputer = InputBox("Please enter the name of the computer [insert a period '.'] for the current machine")
If strComputer = "" Then
wscript(0)
End If
CRLF = Chr(13) & Chr(10) ' carriage return, line feed
strmsg = ""
filename = ""
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)
strmsg=strmsg & "Manufacturer: " & objItem.Manufacturer & CRLF
strmsg=strmsg & "Model: " & objItem.Model & CRLF
strmsg=strmsg & "Name: " & objItem.Name & CRLF
' strmsg=strmsg & "Total Memory: " & objItem.TotalPhysicalMemory & CRLF
strmsg=strmsg & "Memory (MB): " & Memformat & CRLF
filename =filename & objItem.Name
Next
I'm looking to output information about the current machine that the program is running on. i.e. Model, Memory, Mac address. etc. Then once the program has pulled this info up into a webpage, we want to be able to massage the data (edit it) then send it to a database. You would ideally use ASP for this, but right now we do not have the resources to do that, so we're trying to find a short term solution to the problem, so we won't have to key in the data. Which as you know results in finger slips, and curruption of the data.
We have alot of new hardware coming in, and really no defined database. So the long term goal is to use what we learn doing this little chunk right here, and then try to expand the idea.
I first thought to make the code above a sub procedure, then call it from javascript, maybe a document.write or span. But I really have no clue. The main thing I am having trouble with is getting the outputted info in to an Html file, and in a way that it can then be edited. But not copy and pasted. I don't know if this helps you or not.