Sign in to follow this  
Followers 0
RichE

Syschecker V2.8

7 posts in this topic

#1 ·  Posted (edited)

i know other people have done this before, i have one a wrote ages ago, a after feedback have fixed the problems with the code and recompiled the .exe

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        RichE <rich.easton@gmail.com>
;
; Script Function:
;   Syschecker v2.8
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

;variables start
$MEM = MemGetStats()
$desktop = @DesktopDir
$ver = "v2.8"


;c drive stats
$TOTALC = DriveSpaceTotal("C:")
$FREEC = DriveSpaceFree("c:")
$CTOT = Round($TOTALC / 1000, 2)
$CFREE = Round($FREEC / 1000, 2)

;d drive stats
$TOTALD = DriveSpaceTotal("D:")
$FREED = DriveSpaceFree("D:")
$DTOT = Round($TOTALD / 1000, 2)
$DFREE = Round($FREED / 1000, 2)

;mem stats
$MEM1 = Round($MEM[1] / 1000, 0)
$MEM2 = Round($MEM[2] / 1000, 0)

;system info
$bios = regread("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\", "SystemBiosVersion")
$biosdate = regread("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\", "SystemBiosDate")
$cputype = regread("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\", "ProcessorNameString")
$cpuvi = regread("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\", "VendorIdentifier")
$cpu = StringTrimLeft($cputype, 18)
$cpuspd = regread("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\", "~MHz")
$Video = regread("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000\", "DriverDesc")
;variables end

#include <inet.au3>

#include <GuiConstants.au3>


If FileExists( "c:\tip.tmp") Then
   FileDelete("C:\tip.tmp")
EndIf

;start progress bar
ProgressOn("Retreiving Information", " ", "0 percent")
;get internet ip address
InetGet ("http://www.whatismyip.org", "c:\tip.tmp")

If FileExists("c:\tip.tmp") Then
   $TIP = FileReadLine("c:\tip.tmp")
Else
   $TIP = "Not Available"
EndIf
;set progress 100%
ProgressSet(100, "Done", "Complete")
Sleep(300)
ProgressOff()


Opt("GUIOnEventMode", 1)



GuiCreate ("Sys Checker " & $ver, 500, 510, (@DesktopWidth - 410) / 2, (@DesktopHeight - 500) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

$GROUP_1 = GuiCtrlCreateGroup ("Computer", 10, 10, 370, 230)

$LABEL_1 = GuiCtrlCreateLabel ("Computer Name:", 30, 34, 130, 20)
$INPUT_1 = GuiCtrlCreateInput (@ComputerName, 170, 30, 200, 20)

$LABEL_2 = GuiCtrlCreateLabel ("Operating System:", 30, 54, 130, 20)
$INPUT_2 = GuiCtrlCreateInput (@OSVersion & " " & @OSBuild & " " & @OSServicePack, 170, 50, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("Username:", 30, 74, 130, 20)
$INPUT_9 = GuiCtrlCreateInput (@UserName, 170, 70, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("Memory:", 30, 94, 130, 20)
$INPUT_9 = GuiCtrlCreateInput ($MEM2 & "MB of " & $MEM1 & "MB", 170, 90, 200, 20)

;mem display
$LABEL_9 = GuiCtrlCreateLabel ("Memory Free", 30, 114, 130, 20)
$PROGRESS_4 = GuiCtrlCreateProgress (170, 110, 200, 20)
GUICtrlSetData ($progress_4, ($MEM[2] * 100) / $MEM[1])

$LABEL_9 = GuiCtrlCreateLabel ("BIOS Type", 30, 134, 130, 20)
$label_10 = GuiCtrlCreateInput ($bios, 170, 130, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("BIOS Date", 30, 154, 130, 20)
$label_10 = GuiCtrlCreateInput ($biosdate, 170, 150, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("CPU type", 30, 174, 130, 20)
    if $cputype Then
    $label_10 = GuiCtrlCreateInput ($cpu, 170, 170, 200, 20)
    Else
    $label_10 = GuiCtrlCreateInput ($cpuvi, 170, 170, 200, 20)
    EndIf

$LABEL_9 = GuiCtrlCreateLabel ("CPU Speed", 30, 194, 130, 20)
$label_10 = GuiCtrlCreateInput ($cpuspd, 170, 190, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("Video Card", 30, 214, 130, 20)
$LABEL_11 = GuiCtrlCreateInput ($VIDEO, 170, 210, 200, 20)

;desktop group
$GROUP_2 = GuiCtrlCreateGroup ("Desktop", 385, 10, 105, 150)

$LABEL_9 = GuiCtrlCreateLabel ("Resolution", 395, 34, 85, 20)
$INPUT_4 = GuiCtrlCreateInput (@DesktopWidth & " x " & @DesktopHeight, 395, 50, 85, 20)
$LABEL_9 = GuiCtrlCreateLabel ("Color Depth", 395, 74, 85, 20)
$INPUT_4 = GuiCtrlCreateInput (@DesktopDepth, 395, 90, 85, 20)
$LABEL_9 = GuiCtrlCreateLabel ("Refresh Rate", 395, 114, 85, 20)
$INPUT_4 = GuiCtrlCreateInput (@DesktopRefresh, 395, 130, 85, 20)




$GROUP_2 = GuiCtrlCreateGroup ("Network", 10, 240, 370, 110)

;lan address
$LABEL_4 = GuiCtrlCreateLabel ("Network IP Address:", 30, 264, 130, 20)
$INPUT_4 = GuiCtrlCreateInput (@IPAddress1, 170, 260, 200, 20)

;internet ip
$LABEL_5 = GuiCtrlCreateLabel ("Internet IP Address:", 30, 284, 120, 20)
$INPUT_5 = GuiCtrlCreateInput ($tip, 170, 280, 200, 20)


$LABEL_6 = GuiCtrlCreateLabel ("Logon Server:", 30, 304, 130, 20)
$INPUT_6 = GuiCtrlCreateInput (@LogonServer, 170, 300, 200, 20)

$LABEL_7 = GuiCtrlCreateLabel ("Logon Domain:", 30, 324, 130, 20)
$INPUT_7 = GuiCtrlCreateInput (@LogonDomain, 170, 320, 200, 20)

$GROUP_3 = GuiCtrlCreateGroup ("Hard Disks" , 10, 350, 370, 110)

;c drive display
$LABEL_9 = GuiCtrlCreateLabel ("C Drive Size:", 30, 374, 130, 20)
$INPUT_9 = GuiCtrlCreateInput ($CFREE & "GB of " & $CTOT & "GB", 170, 370, 200, 20)

$LABEL_9 = GuiCtrlCreateLabel ("C Drive Free:", 30, 394, 130, 20)
$PROGRESS_1 = GuiCtrlCreateProgress (170, 390, 200, 20)
GUICtrlSetData ($progress_1, ($FREEC * 100) / $TOTALC)

;d drive display
$LABEL_9 = GuiCtrlCreateLabel ("D Drive Size:", 30, 414, 130, 20)
   if $dfree = 0 then
      $INPUT_9 = GuiCtrlCreateInput ("Not Available", 170, 410, 200, 20)
      Else
      $INPUT_9 = GuiCtrlCreateInput ($DFREE & "GB of " & $DTOT & "GB", 170, 410, 200, 20)
   EndIf

$LABEL_9 = GuiCtrlCreateLabel ("D Drive Free:", 30, 430, 130, 20)
$PROGRESS_1 = GuiCtrlCreateProgress (170, 430, 200, 20)
   if $freed = 0 Then
      GUICtrlSetData ($progress_1, $freed)
      Else
      GUICtrlSetData ($progress_1, ($FREED * 100) / $TOTALD)
   EndIf








$GROUP_3 = GuiCtrlCreateGroup ("Copyright " & @YEAR, 10, 460, 370, 40)

$LABEL_8 = GuiCtrlCreateLabel ("Created by Richard Easton", 30, 474, 130, 20)
$INPUT_8 = GuiCtrlCreateButton ("http://www.drunkentechie.net", 170, 470, 200)
GUICtrlSetOnEvent(-1, "DTpressed")


$GROUP_2 = GuiCtrlCreateGroup ("Menu", 385, 160, 105, 240)


$button_1 = GUICtrlCreateButton (".HTML Report",  395, 180, 85)
GUICtrlSetOnEvent(-1, "htmlrep")

$button_2 = GUICtrlCreateButton ("Ping Tool",  395, 210, 85)
GUICtrlSetOnEvent(-1, "pingpressed")

$button_3 = GUICtrlCreateButton ("Map Drive",  395, 240, 85)
GUICtrlSetOnEvent(-1, "Mapdpressed")





$button_8 = GUICtrlCreateButton ("About",  395, 335, 85)
GUICtrlSetOnEvent(-1, "aboutpressed")

$button_9 = GUICtrlCreateButton ("Exit",  395, 365, 85)
GUICtrlSetOnEvent(-1, "exitpressed")


GuiSetState ()

GUISetState(@SW_SHOW)

; Just idle around
While 1
    Sleep(10)
Wend

Func DTpressed()

   Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE www.drunkentechie.net", "", @SW_MAXIMIZE)
EndFunc

;about
Func aboutpressed()
msgbox(0, "About", "Version " & $ver & @cr & "Created by Rich Easton" & @CR & @CR & "Please Visit http://www.drunkentechie.net for more info")
EndFunc


;Pingtool
Func pingpressed()
$tm = InputBox("Target to Ping", "Input Target?", "", "", 100, 60)
$var = Ping($tm,250)
   If $var Then
      Msgbox(0,"Status",$tm & " Online", 5)
   ElseIf $tm <> "" then
      Msgbox(0,"Status",$tm & " is not online or not responding", 5)
   Else
      Msgbox(0, "No Input", "No Target Input", 5)
   EndIf
EndFunc
;end

;Mapdrive
Func mapdpressed()
$tm = InputBox("Target Server", "Input Server?", "", "", 100, 60)
$TS = InputBox("Target Share", "Input Share?", "", "", 100, 60)
$let = InputBox("Drive Letter", "Input Drive Letter?", "", "", 100, 60)
$USE = InputBox("Username", "Input Username?", "", "", 100, 60)
$pas = InputBox("Password", "Input Password?", "", "*", 100, 60)
if $tm <> "" or $ts <> "" or $use <> "" or $use <> "" then
      Msgbox(0, "Processing", "Testing connection to " & $tm, 5)
   Else
      msgbox(0,"Warning!!!", "Missing input detected", 5)
   EndIf

$var = Ping($tm,250)
   If $var Then
      Msgbox(0,"Status",$tm & " Online", 5)
      DriveMapAdd($let & ":", "\\" & $tm & "\" & $TS, 0, $use, $pas)
      msgbox(0, "Information", $ts & " on " & $TM & " has been mapped to " & $let & ":")
      RUN("explorer.exe", $let & ":\", @SW_show)

         Else
      Msgbox(0,"Status",$tm & " is not online or not responding", 5)
   EndIf
EndFunc



;htmlrep
Func htmlrep()
$var = FileSaveDialog( "Choose a name.", $desktop, "Report (*.htm)", 3)
; option 3 = dialog remains until valid path/file selected

If @error Then
    MsgBox(4096,"","Save cancelled.")
Else
filewrite($var & ".htm", _
    "<HTML>" & @CR & _
    "<HEAD>" & @CR & _
    "</HEAD>"& @CR & _
    "<title>System Report for " & @computername & "</title>" & @CR & _
    "<body bgcolor='#808080'>" & @CR & @CR & _
    "<TABLE WIDTH='60%' BORDER='0' CELLSPACING='1' CELLPADDING='0' BGCOLOR='#000000'><tr><td bgcolor='skyblue'>  <B><U>Computer Information</U></B>" & @cr & @cr & _
    "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#EFEFEF'><tr><td><B>Computer Name:</B>" & @COMPUTERNAME & "</td></tr>" & @CR & _
    "<tr><td><B>Operating System:</B>" & @OSVersion & " " & @OSBuild & " " & @OSServicePack & "</td></tr>" & @CR & _
    "<tr><td><B>Username:</B>" & @UserName & "</td></tr>" & @CR & _
    "<tr><td><B>Memory:</B> " & $MEM2 & "MB of " & $MEM1 & "MB" & "</td></tr>" & @CR & _
    "<tr><td><B>C drive Size:</B> " & $CFREE & "GB of " & $CTOT & "GB" & "</td></tr>" & @CR & _
    "<tr><td><B>D drive Size:</B> " & $DFREE & "GB of " & $DTOT & "GB" & "</td></tr>" & @CR & _
    "</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR & _
    "<TR><TD bgcolor='skyblue'>  <B><U>Network Information</U></B>" & @CR & _
    "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#EFEFEF'><tr><td><B>Network IP Address:</B> " & @IPAddress1 & "</td></tr>" & @CR & _
    "<tr><td><B>Internet IP Address:</B> " & $tip & "</td></tr>" & @CR & _
    "<tr><td><B>Logon Server:</B> " & @LogonServer & "</td></tr>" & @CR & _
    "<tr><td><B>Logon Domain:</B> " & @LogonDomain & "</td></tr>" & @CR & _
    "</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR & _
    "<TR><TD bgcolor='skyblue'>  <B><U>Desktop Information</U></B>" & @CR & _
    "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#EFEFEF'><tr><td><B>Resolution:</B> " & @DesktopWidth & " x " & @DesktopHeight & "</td></tr>" & @CR & _
    "<tr><td><B>Color Depth:</B> " & @DesktopDepth & "</td></tr>" & @CR & _
    "<tr><td><B>Refresh Rate:</B> "  & @DesktopRefresh & "</td></tr>" & @CR & _
    "</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR & _
    "<TR><TD bgcolor='skyblue'>  <B><U>Copyright</U></B>" & @CR & _
    "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#EFEFEF'><tr><td><B>Rich Easton</B> " & "©2005 <A href='http://www.drunkentechie.net'>Drunkentechie.net</A></td></tr>" & @CR & _
    "<tr><td><B>Email:</B><a href='mailto:rich.easton@gmail.com?subject=Sys Check Feedback'>Rich.easton@gmail.com</A></td></tr>" & @CR & _
    "</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR )
    MsgBox(4096,"","You chose " & $var & ".htm")
    Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & $var & ".htm", "", @SW_MAXIMIZE)
EndIf




EndFunc

Func SpecialEvents()


    Select
        Case @GUI_CTRLID = $GUI_EVENT_CLOSE
            Exit

        Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE

        Case @GUI_CTRLID = $GUI_EVENT_RESTORE

    EndSelect

EndFunc

Func exitpressed()
filedelete("c:\tip.tmp")
Exit
EndFunc



While 1
  sleep(200)
WEnd
Exit
Edited by l15ard

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Share this post


Link to post
Share on other sites



showed 29 errors in my version of SciTE v1.68, running AutoIt 3.1.1 perhaps those would be solved with the new beta... rather thorough script though, compared to the other ones in the forum...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nice toy :think:

On AutoIt beta 3.1.1.115 got a few errors which were easily "fixed". Changed:

Line 471 (not needed as declared already):

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

Line 629:

msgbox(0, "About", "Version " & $ver & @cr & "Created by Rich Easton" & @CR & @CR & "Please Visit [url=http://www.drunkentechie.net"]http://www.drunkentechie.net"[/url] & @CR & "for more info")

msgbox(0, "About", "Version " & $ver & @cr & "Created by Rich Easton" & @CR & @CR & "Please Visit [url=http://www.drunkentechie.net]http://www.drunkentechie.net[/url]" & @CR & "for more info")

Line 706:

"</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR &_

"</TABLE></TD></TR><TR bgcolor='#efefef'><TD> </TD></TR>" & @CR & _

Lines 742+:

While 1
  sleep(200)
WEnd
Exit
:( PS - don't think you can hyperlink in messagebox that easy - only using a GUI or "custom" messagebox script (i think gafrost made one for example) Edited by plastix

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

most of the errors comes from the part that output the html report, for some reason SciTE doesn't seem to like it, but in practise it seems to work ok, thx for the feedback

Believe me that they are real errors and AutoIt3 will stop executing when it has to perform those lines.

The difference between the Errors you see in SciTE which are generated by Au3Check is that AU3Check does a check of the whole program for errors, were AutoIt3 just runs the lines until it hits an error.

:think:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

:think: PS - don't think you can hyperlink in messagebox that easy - only using a GUI or "custom" messagebox script (i think gafrost made one for example)

Actually I've done a few, 1 is using a label in child gui, the other is a true hyperlink control, both are linked in my signature.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

thx for the feedback guys, i've updated the code and .exe and I'll be more careful in the future. :think:

Edited by l15ard

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Great

PS:

;Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE www.drunkentechie.net", "", @SW_MAXIMIZE)
$ProgramFiles =regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
Run($ProgramFiles &"\Internet Explorer\IEXPLORE.EXE www.drunkentechie.net", "", @SW_MAXIMIZE)
;MsgBox(262144, "", $ProgramFiles)
Edited by Lapo

Share this post


Link to post
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
Sign in to follow this  
Followers 0