Results 1 to 3 of 3

Thread: Getting a users System Information (tricky)

  1. #1

    Thread Starter
    Addicted Member Illiad's Avatar
    Join Date
    Mar 2003
    Location
    Chicago
    Posts
    196

    Getting a users System Information (tricky)

    Is there a way to get a users system information:
    -Windown Version
    -Remaining Disk Space
    -Running Applications

    and all that other good stuff?
    any tips/tricks would be most usefull!

  2. #2
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    The following are quick samples from allapi.com:

    1. Windows version
    VB Code:
    1. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
    2. Private Type OSVERSIONINFO
    3.     dwOSVersionInfoSize As Long
    4.     dwMajorVersion As Long
    5.     dwMinorVersion As Long
    6.     dwBuildNumber As Long
    7.     dwPlatformId As Long
    8.     szCSDVersion As String * 128
    9. End Type
    10. Private Sub Form_Load()
    11.     Dim OSInfo As OSVERSIONINFO, PId As String
    12.     'KPD-Team 1998
    13.     'URL: [url]http://www.allapi.net/[/url]
    14.     'Set the graphical mode to persistent
    15.     Me.AutoRedraw = True
    16.     'Set the structure size
    17.     OSInfo.dwOSVersionInfoSize = Len(OSInfo)
    18.     'Get the Windows version
    19.     Ret& = GetVersionEx(OSInfo)
    20.     'Chack for errors
    21.     If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub
    22.     'Print the information to the form
    23.     Select Case OSInfo.dwPlatformId
    24.         Case 0
    25.             PId = "Windows 32s "
    26.         Case 1
    27.             PId = "Windows 95/98"
    28.         Case 2
    29.             PId = "Windows NT "
    30.     End Select
    31.     Print "OS: " + PId
    32.     Print "Win version:" + str$(OSInfo.dwMajorVersion) + "." + LTrim(str(OSInfo.dwMinorVersion))
    33.     Print "Build: " + str(OSInfo.dwBuildNumber)
    34. End Sub
    2. Disk free space
    VB Code:
    1. 'In general section
    2. Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
    3.  
    4. Private Sub Form_Load()
    5.     'KPD-Team 1998
    6.     'URL: [url]http://www.allapi.net/[/url]
    7.     'E-Mail: [email][email protected][/email]
    8.  
    9.     Dim Sectors as Long,Bytes as Long,FreeC as Long, TotalC as Long,Total as Long,Freeb as Long
    10.     'Retrieve information about the C:\
    11.     GetDiskFreeSpace "C:\", Sectors, Bytes, Freec, Totalc
    12.     'Set graphic mode to persistent
    13.     Me.AutoRedraw = True
    14.     'Print the information to the form
    15.     Me.Print " Path: C:\"
    16.     Me.Print " Sectors per Cluster:" + Str$(Sector)
    17.     Me.Print " Bytes per sector:" + Str$(Bytes)
    18.     Me.Print " Number Of Free Clusters:" + Str$(Freec)
    19.     Me.Print " Total Number Of Clusters:" + Str$(Totalc)
    20.     Total = rTotalc& * rSector& * rBytes&
    21.     Me.Print " Total number of bytes in path:" + Str$(Total)
    22.     Freeb = rFreec& * rSector& * rBytes&
    23.     Me.Print " Free bytes:" + Str$(Freeb)
    24. End sub
    3. It's a little too much for posting here.
    McGenius

  3. #3
    Member
    Join Date
    Feb 2003
    Location
    New Delhi, India
    Posts
    63

    Lightbulb

    try out opening this

    winmsd.exe
    Failures are divided into two classes --
    those who thought and never did, and those who did and never thought.
    - John Charles Salak

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width