Jump to content

System information


cppman
 Share

Recommended Posts

Another program i made...

This one tells you information about your system.

File: Main.au3

; Script generated by AutoBuilder 0.6 Prototype
#include <GuiConstants.au3>
#include "constants.au3"
#include <array.au3>
#include <date.au3>
ProgressOn("Please Wait...", "Gathering Information")
$UsedSpace = DriveSpaceTotal(@HomeDrive) & "(MB)"
$FreeSpace = DriveSpaceFree(@HomeDrive) & "(MB)"
$FileSystem = DriveGetFileSystem(@HomeDrive)
$DriveLabel = DriveGetLabel(@HomeDrive)
$DriveSerial = DriveGetSerial(@HomeDrive)
$DriveType = DriveGetType(@HomeDrive)
$DriveStatus = DriveStatus(@HomeDrive)
ProgressSet(100)
Sleep(2000)
ProgressOff()
GUICreate("Computer Diagnostics", 657, 559, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$ProcessGroup = GUICtrlCreateGroup("Process Information", 6, 22, 360, 270)
$ProcessList = GUICtrlCreateList("", 12, 67, 351, 110)
$RunningProcessesLabel = GUICtrlCreateLabel("Running Processes", 118, 45, 115, 15)
$ProcessDescLabel = GUICtrlCreateLabel("Process Description:", 14, 198, 119, 20)
$ProcessDesc = GUICtrlCreateLabel("Description", 36, 221, 280, 49)
$SystemInformationGroup = GUICtrlCreateGroup("System Information", 6, 304, 358, 243)
$SoftwareInformationGroup = GUICtrlCreateGroup("Software Information", 371, 22, 283, 270)
$MiscInfoGroup = GUICtrlCreateGroup("Misc. Information", 370, 303, 279, 244)
;System Information
GUICtrlCreateLabel("Windows Version: " & " " & $WindowsVer, 50, 330)
GUICtrlCreateLabel("Windows Build: " & " " & $BUILD, 50, 350)
GUICtrlCreateLabel("Windows Service pack: " & " " & $ServicePack, 50, 370)
GUICtrlCreateLabel("Windows Defualt Language: " & " " & _Language(), 50, 390)
GUICtrlCreateLabel("Used Hard Drive Space: " & " " & $UsedSpace, 50, 410)
GUICtrlCreateLabel("Free Hard Drive Space: " & " " & $FreeSpace, 50, 430)
GUICtrlCreateLabel("Hard Drive Label: " & " " & $DriveLabel, 50, 450)
GUICtrlCreateLabel("Hard Drive Serial: " & " " & $DriveSerial, 50, 470)
GUICtrlCreateLabel("Hard Drive Type: " & " " & $DriveType, 50, 490)
GUICtrlCreateLabel("Hard Drive Status: " & " " & $DriveStatus, 50, 510)
;Software Information
GUICtrlCreateLabel("Java Version: " & $JavaVer, 380, 50)
$CookiesSize = DirGetSize($CookiesDir) / 1024 & "(KB)"
$TemPSize = DirGetSize($TempDir) / 1024 & "(KB)"
$Cookie_Label = GUICtrlCreateLabel("Cookies Size: " & $CookiesSize, 380, 70)
$TempLabel = GUICtrlCreateLabel("Temp Size: " & $TemPSize, 380, 90)
$DelCookies = GUICtrlCreateButton("Delete Cookies", 380, 110, 100, -1)
$DelTemp = GUICtrlCreateButton("Delete Temp", 480, 110, 100, -1)
;Misc. Information
GUICtrlCreateLabel("Installed Fonts", 380, 320)
$FontList = GUICtrlCreateList("", 380, 350, 250, 100)
$Time = GUICtrlCreateLabel("System Time: ", 380, 500)
$TimeObject = GUICtrlCreateLabel("", 490, 500, 100, 100)
$Fonts = _FileListToArray (@HomeDrive & "\windows\fonts", "*.ttf", 1)
For $i = 1 To $Fonts[0]
 GUICtrlSetData($FontList, $Fonts[$i])
Next
GUISetState()
$Process = ProcessList()
For $i = 1 To $Process[0][0]
 GUICtrlSetData($ProcessList, $Process[$i][0])
Next
While 1
 GUICtrlSetData($TimeObject, _NowTime())
 $DescData = GUICtrlRead($ProcessList)
 If $DescData = "explorer.exe" Then
  $ProcData = "Microsoft Windows Explorer"
 Else
  If $DescData = "alg.exe" Then
   $ProcData = "Microsoft Windows Application Layer Gateway Service"
  Else
   If $DescData = "wscntfy.exe" Then
    $ProcData = "Windows Security Center"
   Else
    If $DescData = "hkcmd.exe" Then
     $ProcData = "Intel Hotkey command activator"
    Else
     If $DescData = "cidaemon.exe" Then
      $ProcData = "Microsoft Indexing Service"
     Else
      If $DescData = "msnmsgr.exe" Then
       $ProcData = "MSN Messenger"
      Else
       If $DescData = "igfxtray.exe" Then
        $ProcData = "Intel(R) Graphics Accelerator Helper"
       Else
        If $DescData = "cisvc.exe" Then
         $ProcData = "Microsoft Index Service Helper"
        Else
         If $DescData = "spoolsv.exe" Then
          $ProcData = "Microsoft Printer Spooler Service"
         Else
          If $DescData = "svchost.exe" Then
           $ProcData = "Microsoft Service Host Process"
          Else
           If $DescData = "mqtgsvc.exe" Then
            $ProcData = "Message Queuing Triggers Service"
           Else
            If $DescData = "iexplore.exe" Then
             $ProcData = "Microsoft Internet Explorer"
            Else
             If $DescData = "lsass.exe" Then
              $ProcData = "Local Security Authority Service"
             Else
              If $DescData = "services.exe" Then
               $ProcData = "Windows Service Controller"
              Else
               If $DescData = "winlogon.exe" Then
                $ProcData = "Microsoft Windows Logon Process"
               Else
                If $DescData = "csrss.exe" Then
                 $ProcData = "Microsoft Client/Server Runtime Server Subsystem"
                Else
                 If $DescData = "smss.exe" Then
                  $ProcData = "Session Manager Subsystem"
                 Else
                  If $DescData = "mqsvc.exe" Then
                   $ProcData = "Microsoft Message Queue Server"
                  Else
                   If $DescData = "taskmgr.exe" Then
                    $ProcData = "Windows Task Manager"
                   Else
                    If $DescData = "wdfmgr.exe" Then
                     $ProcData = "Windows Driver Foundation Manager"
                    Else
                     If $DescData = "[System Process]" Then
                      $ProcData = "System Idle Process"
                     Else
                      $Files = StringSplit($DescData, ".")
                      $ProcData = $Files[1]
                     EndIf
                    EndIf
                   EndIf
                  EndIf
                 EndIf
                EndIf
               EndIf
              EndIf
             EndIf
            EndIf
           EndIf
          EndIf
         EndIf
        EndIf
       EndIf
      EndIf
     EndIf
    EndIf
   EndIf
  EndIf
  GUICtrlSetData($ProcessDesc, $ProcData)
 EndIf
 $msg = GUIGetMsg()
 Select
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
  Case $msg = $DelCookies
   DelCookies()
  Case $msg = $DelTemp
   DelTemp()
 EndSelect
WEnd
Func _Language()
 Select
  Case StringInStr("0413,0813", @OSLang)
   Return "Dutch"
  Case StringInStr("0409,0809,0c09,1009,1409,1809,1c09,2009, 2409,2809,2c09,3009,3409", @OSLang)
   Return "English"
  Case StringInStr("040c,080c,0c0c,100c,140c,180c", @OSLang)
   Return "French"
  Case StringInStr("0407,0807,0c07,1007,1407", @OSLang)
   Return "German"
  Case StringInStr("0410,0810", @OSLang)
   Return "Italian"
  Case StringInStr("0414,0814", @OSLang)
   Return "Norwegian"
  Case StringInStr("0415", @OSLang)
   Return "Polish"
  Case StringInStr("0416,0816", @OSLang)
   Return "Portuguese"
  Case StringInStr("040a,080a,0c0a,100a,140a,180a,1c0a,200a, 240a,280a,2c0a,300a,340a,380a,3c0a,400a, 440a,480a,4c0a,500a", @OSLang)
   Return "Spanish"
  Case StringInStr("041d,081d", @OSLang)
   Return "Swedish"
  Case Else
   Return "Other (can't determine with @OSLang directly)"
 EndSelect
EndFunc  ;==>_Language
Func DelCookies()
 FileDelete(@HomeDrive & "\documents and settings\" & @UserName & "\cookies\*.*")
 MsgBox(0, "Complete!", "Completed Deleting Files!", 3)
 GUICtrlSetData($Cookie_Label, "Cookies Size: " & DirGetSize(@HomeDrive & "\Documents and Settings\" & @UserName & "\Cookies") / 1024 & "(KB)")
EndFunc  ;==>DelCookies
Func DelTemp()
 ProgressOn("Deleting Temp", "please wait...")
 FileDelete(@HomeDrive & "windows\temp\*.*")
 ProgressSet(100)
 ProgressOff()
 MsgBox(0, "Complete!", "Files deleted successfuly!", 3)
 GUICtrlSetData($TempLabel, "Temp Size: " & DirGetSize(@HomeDrive & "\windows\temp\") / 1024 & "(KB)")
EndFunc  ;==>DelTemp
Exit

File: Constants.au3

; Global Constants
#include <file.au3>
;Main Directories
Global Const $SystemDir = @HomeDrive & "\windows\system32"
Global Const $WinDir = @HomeDrive & "\windows"
Global Const $DocumentSettingsDir = @HomeDrive & "\documents and settings"
Global Const $CurUserDir = @HomeDrive & "\documents and settings\" & @UserName
Global Const $CookiesDir = $CurUserDir & "\cookies"
Global Const $TempDir = @HomeDrive & "\windows\temp"
;Get Java Version
$java = _FileListToArray (@ProgramFilesDir & "\java\")
If (IsArray($java)) Then
 Global Const $JavaVer = $java[1]
Else
 $JavaVer = "Java Not Installed"
EndIf
;Windows Version
Global Const $WindowsVer = @OSTYPE
Global Const $Build = @OSBuild
Global Const $ServicePack = @OSServicePack
Global Const $Language = @OSLang
;Processor
Global Const $Processor = @ProcessorArch
;SystemDir
;WinDir
;DocumentSettingsDir
;CurUserDir
;CookiesDir
;TempDir
;JavaVer
;WindowsVer
;Build
;ServicePack
;Processor
Link to comment
Share on other sites

Hi!

Just a little hint:

use selcet or switch instead of if..the.else!

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Ok guys i was playing with crise's script and I hit a lil problem wich made me curious.... At first when I downloaded it his script ran fine. Then I swiched all the if statements in main.au3 to select (source included) then tried to run it again and it gave me and error in the Constants.au3 wich I had never edited. It was telling me that I was trying to change a cons variable ($JavaVer) and there was a if else statement there so I know that constants can't be changed so i took the const of and now it runs fine.

Here is my question why did autoit acuse the error when i was running the the select statement but not the if statement? Does auto it compile the script as it goes or does it compile every part of it before running it? If it does compile it as it goes I have java instaled and so it should never have reached that error in eather case but it did. If it compiles the whole script before running should the error not have showed up when if was used also?

Any ideas, explanetions, deductions on this would help quite a bit.

PS: Sorry for the bad english....

Brain overload :o

Main.au3

Constants.au3

Link to comment
Share on other sites

Doesnt work for me :o ;(

What do u mean? What kind of error do you get? and do you have windows xp? (This only works with windows XP).

also, u gotta have the beta.

this is weird. everything worked fine with the if statements, but with the case statements, the Process Description does'nt even change.... what did u do to my poor little program? lol. jk.

weird.

Edited by CHRIS95219
Link to comment
Share on other sites

lol. Also, for some reason, the DelCookies() and DelTemp() functions arew'nt working right. their not deleting the cookies. i just noticed that, anyone have any ideas of what is wrong with it?

I've run into problems before using *.* ( or even just *) on XP so I run the folder through a find file function to get the full path and file name and put it into a StringSplit and then a For/Next loop.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...