Question : Retrieve PC System Info through Lotus Notes button

Is there a way to retrieve the pc info (RAM, hard disk space) through Lotus Formula or Script?  I want to send an email to my users with a button that they can click then this button will then send me an email containing the RAM and hard disk space of the user.

Answer : Retrieve PC System Info through Lotus Notes button

I've rewritten the last part about retrieving memory configuration... This also works on my machine - but how about yours :-)

      Dim sess As New NotesSession
      Dim db As notesdatabase
      Set db =sess.currentdatabase
      Dim doc As New notesdocument(db)
      Dim itm As NotesRichTextItem
      
      Call doc.ReplaceItemValue("subject", "Hardware info obtained from " & sess.CommonUserName)
      Set itm = doc.CreateRichtextItem("Body")
      
      Call itm.AppendText("Free diskspace on all drives")
      Call itm.AddNewline(1)
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:"      & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk Where DeviceID = 'C:'")
      Forall objDisk In colDisks
            Call itm.AppendText(objDisk.Name)
            Call itm.AddTab(2)
            Call itm.AppendText(objDisk.FreeSpace)
            Call itm.AddNewline(1)
      End Forall
      Set objWMIService = Nothing
      Set colDisks = Nothing
      
      
      Call itm.AddNewline(3)
      Call itm.AppendText("Memory configuration")
      Call itm.AddNewline(1)
      
      Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystem")
      
      Forall comp In colSettings
            Call itm.AppendText("Total physical memory (bytes): " & comp.TotalPhysicalMemory)
      End Forall
      
      Set objWMIService = Nothing
      Set colSettings = Nothing
      
      Call doc.Send(False, "[enter recipient mailaddress here]")
Random Solutions  
 
programming4us programming4us