Inventory in ASP

Discussion in 'ASP General' started by jay_kbvt, Jan 21, 2006.

  1. jay_kbvt

    jay_kbvt Guest

    Hi,

    I m new to ASP. I have written a script to take inventory of PCs on my
    network in an excel spreadsheet. I want it to be available whenever
    wherever needed by my managers and other accounts/purchase people. Is
    there any way possible that I can put it on my intranet website using
    ASP...????

    Thanx in advance....

    Jaydeep.

    Script Code goes here.
    '---------------------------------------------------------------------------------------------------------
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Add
    x = 1
    For i = 1 To 15
    objExcel.Cells(x, i).Font.Bold = True
    Next
    objExcel.Cells(1, 1).Value = "Machine Name"
    objExcel.Cells(1, 2).Value = "# of Procs"
    objExcel.Cells(1, 3).Value = "Proc Type"
    objExcel.Cells(1, 4).Value = "Max Clock Speed"
    objExcel.Cells(1, 5).Value = "Tot Phy Mem"
    objExcel.Cells(1, 6).Value = "Free Phy Mem"
    objExcel.Cells(1, 7).Value = "Tot Virtual Mem"
    objExcel.Cells(1, 8).Value = "Free Virtual Mem"
    objExcel.Cells(1, 9).Value = "Tot Visible Mem"
    objExcel.Cells(1, 10).Value = "Manufacturer"
    objExcel.Cells(1, 11).Value = "Model"
    objExcel.Cells(1, 12).Value = "OS Serial Number"
    objExcel.Cells(1, 13).Value = "Machine Serial Number"
    objExcel.Cells(1, 14).Value = "Free Space"
    objExcel.Cells(1, 15).Value = "File System"
    objExcel.Cells(1, 16).Value = "Device ID"
    ''''''''''''''''''
    x = 2
    strComputers = InputBox _
    ("What computer would you like info on?", _
    "Inventory.", strLocalComputer)
    On Error Resume Next
    Set objNetwork = CreateObject("Wscript.Network")
    strLocalComputer = objNetwork.ComputerName
    If strComputers = "" Then
    WScript.Quit
    End If
    '''''''
    arrComputers = Split(strComputers, " ")
    For Each strComputer In arrComputers


    objExcel.Cells(x, 1).Value = strComputer
    x = x + 1
    y = x - 1
    ''''''''''''''
    Set objWMIService = GetObject("winmgmts:\\" & strComputer &
    "\root\CIMV2")
    Set colCSes = objWMIService.ExecQuery("SELECT * FROM
    Win32_ComputerSystem")
    For Each objCS In colCSes
    objExcel.Cells(y, 2).Value = objCS.NumberOfProcessors
    Next
    Set colProcessors = objWMIService.ExecQuery("Select * from
    Win32_Processor")
    For Each objProcessor In colProcessors
    objExcel.Cells(y, 3).Value = objProcessor.Name
    objExcel.Cells(y, 4).Value = objProcessor.MaxClockSpeed
    Next
    Set objWMIService = GetObject("winmgmts:\\" & strComputer &
    "\root\CIMV2")
    Set colCSItems = objWMIService.ExecQuery("SELECT * FROM
    Win32_ComputerSystem")
    For Each objCSItem In colCSItems
    objExcel.Cells(y, 5).Value = objCSItem.TotalPhysicalMemory
    Next
    Set colOSItems = objWMIService.ExecQuery("SELECT * FROM
    Win32_OperatingSystem")
    For Each objOSItem In colOSItems
    objExcel.Cells(y, 6).Value = objOSItem.FreePhysicalMemory
    objExcel.Cells(y, 7).Value = objOSItem.TotalVirtualMemorySize
    objExcel.Cells(y, 8).Value = objOSItem.FreeVirtualMemory
    objExcel.Cells(y, 9).Value = objOSItem.TotalVisibleMemorySize
    Next
    Set objWMIService = GetObject("winmgmts:\\" & strComputer &
    "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM
    Win32_ComputerSystem")
    For Each objItem In colItems
    objExcel.Cells(y, 10).Value = objItem.Manufacturer
    objExcel.Cells(y, 11).Value = objItem.Model
    Next
    Set colOperatingSystems = objWMIService.ExecQuery("Select * from
    Win32_OperatingSystem")
    For Each objOperatingSystem In colOperatingSystems
    objExcel.Cells(y, 12).Value = objOperatingSystem.SerialNumber
    Next
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS")
    For Each objItem In colItems
    objExcel.Cells(y, 13).Value = objItem.SerialNumber
    Next

    Const CONVERSION_FACTOR = 1048576
    Set colItems = objWMIService.InstancesOf("SELECT * FROM
    Win32_LogicalDisk")
    For Each objItem In colItems
    FreeMegaBytes = objItem.FreeSpace / CONVERSION_FACTOR
    objExcel.Cells(y, 14).Value = objItem.FreeMegaBytes
    objExcel.Cells(y, 15).Value = objItem.FileSystem
    objExcel.Cells(y, 16).Value = objItem.DeviceID
    Next
    jay_kbvt, Jan 21, 2006
    #1
    1. Advertising

  2. jay_kbvt

    McKirahan Guest

    "jay_kbvt" <> wrote in message
    news:...
    > Hi,
    >
    > I m new to ASP. I have written a script to take inventory of PCs on my
    > network in an excel spreadsheet. I want it to be available whenever
    > wherever needed by my managers and other accounts/purchase people. Is
    > there any way possible that I can put it on my intranet website using
    > ASP...????


    [snip]

    File + Save As (Save as type = Web page)
    McKirahan, Jan 21, 2006
    #2
    1. Advertising

  3. jay_kbvt

    Guest

    I'd suggest putting the data into an Access database and perhaps look
    at some of the database examples at www.asp101.com/samples

    But in more direct answer to your question:

    Using Excel Spreadsheets as Web Data Sources by Steven Raines -
    11/23/1999
    http://www.algonquinstudios.com/Home/Tech/ExcelWebDataSources

    Extract data from Excel Spreadsheet using ASP by Nabeel Akhtar -
    9/25/2005
    http://www.geekpedia.com/tutorial143_Extract-data-from-Excel-Spreadsheet-using-ASP.html

    VBScript and Excel
    http://www.greggriffiths.org/webdev/both/excel/

    Best regards,
    -Paul
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips
    , Jan 23, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Inventory in ASP.

    , Jan 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,074
    =?Utf-8?B?RWx0b24gVw==?=
    Jan 21, 2006
  2. David Tuman

    directory inventory

    David Tuman, Feb 10, 2004, in forum: C++
    Replies:
    3
    Views:
    416
    Christoph Rabel
    Feb 10, 2004
  3. lalalala

    inventory databasing

    lalalala, May 26, 2006, in forum: Java
    Replies:
    1
    Views:
    798
    IchBin
    May 26, 2006
  4. Lisa Fong
    Replies:
    0
    Views:
    339
    Lisa Fong
    Feb 16, 2007
  5. =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg

    Print Label on LOCAL Zebra Printer from WEBSITE Inventory DB

    =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg, Apr 25, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,363
    Alexey Smirnov
    Apr 26, 2007
Loading...

Share This Page