timassin
-
Total Posts
:
14
- Scores: 0
-
Reward points
:
0
- Joined: 11/14/2011
-
Status: offline
|
help with inventory script
Thursday, November 24, 2011 2:22 AM
( permalink)
Hello, I'm currently trying to write a script to help us with our inventory this year. I've just started using vbscript and I am stuck with my script. Currently this is what I have, Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Set objWMIService = _
GetObject("winmgmts:{impersonationLevel=impersonate}//./root/cimv2")
Set colSoftware = objWMIService.ExecQuery("SELECT * FROM Win32_Product")
SET objFS = CreateObject ("Scripting.FileSystemObject")
SET objNewFile = objFS.CreateTextFile("\\server\share" & strComputerName & ".htm")
objNewFile.WriteLine "<html>"
objNewFile.WriteLine "<head>"
objNewFile.WriteLine "<title>Software Report</title>"
objNewFile.WriteLine "</head>"
objNewFile.Writeline "<body>"
objNewFile.Writeline "<h1>Software Report -- Date: " & Now() & _
"</h1>" & vbCrlf
objNewFile.WriteLine "<table BORDER=1>"
For Each objSoftware In colSoftware
objNewFile.WriteLine "<tr>"
objNewFile.WriteLine _
"<td>Software:</td><td>" & objSoftware.Name & "</td>"
objNewFile.WriteLine "</tr>"
NEXT
objNewFile.WriteLine "</table>"
objNewFile.WriteLine "</body>"
objNewFile.WriteLine "</html>"
objNewFile.Close It query's the software installed and outpouts it as html to a share, I would like to get the Internet explorer Version and Firefox version added in there aswell but they are housed elsewhere from what I know here, "\root\cimv2\Applications\MicrosoftIE") strIESetting.Version FireFox I'm not to sure about. Also to display Monitor I'm not to sure about. Thanks for the Help, Tim
|
|
|
|