Blogs

  • Browse Blogs
  • My Blog
  • My Updates

Tags Help

  • View as cloud  | list

Similar Blogs

photo

TexasSwede

70 Entries |  Karl-Henry Martinsso...
Updated 
No Ratings 0     Comments 61
photo

Big A** Mutan...

42 Entries |  Michael Smelser
Updated 
Ratings 1     Comments 41
photo

B's Blog

29 Entries |  Bob Seifert
Updated 
No Ratings 0     Comments 22
photo

Lotus Nut

74 Entries |  Chris Whisonant
Updated 
Ratings 6     Comments 103
photo

FlowerPower

35 Entries |  James T Kork
Updated 
No Ratings 0     Comments 20

Dogear Bookmarks

PayDirt

Blog Authors:  Brett Patterson  

All entries tagged with lotusscript

A Little Teaser

Brett Patterson  |    |  Tags:  lotusscript windows  |  Comments (5)
Retrieve all partition info from any windows server:

 Partition Info:
(A:)  3 1/2 Inch Floppy Drive
(C:)  NTFS  19.99GB (12.56GB Free) 
(D:)  NTFS  39.99GB (5.96GB Free)  Data
(E:)  CD-ROM Disc


This is a function in a script library.  I use a scheduled agent to pull this data daily and write to a notes document.

Sub getPartitionInfo(doc As NotesDocument, strComputer As String)
    Dim strPartition As String
    
    strPartition = ""
    
    On Error Goto errorHandler
    
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2";)
    Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk",,48)
    Forall objItem In colItems
'This shows the different info you can actually query.
        Print "Caption: " & objItem.Caption
        Print "Description: " & objItem.Description
        Print "DeviceID: " & objItem.DeviceID
        Print "DriveType: " & objItem.DriveType
        Print "FileSystem: " & objItem.FileSystem
        Print "FreeSpace: " & objItem.FreeSpace
        Print "Name: " & objItem.Name
        Print "ProviderName: " & objItem.ProviderName
        Print "Size: " & objItem.Size
        Print "VolumeName: " & objItem.VolumeName
'Check if it's a Disk Drive (thus no memory) and just return it's drive letter and description
        If objItem.DriveType = 2 Or objItem.DriveType = 5 Or objItem.DriveType = 4 Then
            strPartition = strPartition + "(" + objItem.DeviceID + ";)  " + objItem.Description + Chr(13)
        Else
'Show drive letter, description, total memory and remaining memory.
            strPartition = strPartition + "(" + objItem.DeviceID + ";)  " + objItem.FileSystem + _
            "  " + Cstr(Round(objItem.Size/1024/1024/1024,2)) + "GB (" Cstr(Round(objItem.FreeSpace/1024/1024/1024,2)) + _
            "GB Free)  " + objItem.VolumeName + Chr(13)
        End If
    End Forall
    doc.PartitionInfo = strPartition
    
    Exit Sub
    
errorHandler:
    Print "Could not access Partition Info.  Error " & Err & ": " & Error$ + " at line " & Erl
    Exit Sub
    
End Sub

Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About

Tags

A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.