Sign in to follow this  
Followers 0
RichE

Admin Tools And Utils (cchs)

3 posts in this topic

I work at a school and use various apps quite frequently, so i've written a admin tools programs, that has the following:

  • Update checking - reads a file from the network install dir and compares
  • multiple server ping
  • ping results parsed into an edit box
  • inbuilt google search and image search
  • firefox and avant browser integration and saving of prefs into the registry
  • calender
though most of the apps won't work outside of the school and the registry entries get defined on install (or saving prefs) some of the code maybe useful for someone.

and the update checking will come in useful for anyone who consistantly updates apps and doesn't want to send an email out to hundreds of ppl, just instegate the update warning by changing the ver.txt located in the network install dir :think:

the searches are currently co.uk, and .ca for the image search and will open either firefox, avant or ie

anyway here's the code:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        RichE rich.easton@gmail.com
;
; Script Function:
;   Admin tools v1.1
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here
$ver = 1.1
$update = FileReadLine("\\cchs_ut\Storage\System software\Admin Workstation\Admin Tools\ver.txt", 1)
$path = regread("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "InstallPath")
$username = @UserName
$time = @hour & ":" & @MIN
$date = @MDAY & "/" & @MON & "/" & @YEAR
$firefox = regread("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox")
$avant = regread("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant")
$ltime = regread("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "time")
$ldate = regread("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "date")
regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "time", "REG_SZ", $time)
regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "date", "REG_SZ", $date)


if $ver <> $update Then
    msgbox(64, "New version", "there is a newer version of admin tools available, please run the setup file", 5)
EndIf






#include <GuiConstants.au3>
#include <File.au3>

Opt("GUIOnEventMode", 1)


GuiCreate("CCHS Admin Tools V" & $ver, 700, 450)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetFont(12, 400,-1, "veranda")
Guictrlcreatelabel("Welcome " & $username & ", you last ran Admin Tools at " & $ltime & " on " & $ldate, 5, 5, 450, 20)
if  $ver <> $update Then
    GUISetFont(12, 1200,-1, "veranda")
    Guictrlcreatelabel("* New version Available *", 480, 5, 200, 20)
    GUICtrlSetColor(-1,0xff0000)
    EndIf

GUISetFont(12, 400,-1, "veranda")
guictrlcreatetab(5,40,690,350, $TCS_SCROLLOPPOSITE)






GUICtrlCreateTabItem("RM Apps")

;RM Management Console
GUICtrlCreateButton("RM Management Console", 15,80, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\rmman.ico")
GUICtrlSetTip(-1,"RM Management Console")
GUICtrlSetOnEvent(-1, "RMManC")
GUICtrlCreateLabel("RM Management Console", 60, 90,150,20)

;RM Remote Admin
GUICtrlCreateButton("RM Remote Admin", 15,120, 36,36, $BS_ICON)
GUICtrlSetImage (-1, "C:\Program Files\Radmin\radmin.exe")
GUICtrlSetTip(-1,"RM Remote Admin")
GUICtrlSetOnEvent(-1, "RMrema")
GUICtrlCreateLabel("RM Remote Admin", 60, 130,150,20)

;RM Auditor
GUICtrlCreateButton("RM Auditor", 15,160, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\Audit.ico")
GUICtrlSetTip(-1,"RM Auditor")
GUICtrlSetOnEvent(-1, "RMaudi")
GUICtrlCreateLabel("RM Auditor", 60, 170,150,20)









GUICtrlCreateTabItem("Web Apps")
;Helpdesk
GUICtrlCreateButton("Helpdesk", 15,80, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\helpdesk.ico")
GUICtrlSetTip(-1,"CCHS Helpdesk")
GUICtrlSetOnEvent(-1, "Helpdesk")
GUICtrlCreateLabel("CCHS Helpdesk", 60, 90,150,20)

;Web filtering
GUICtrlCreateButton("Web Filtering", 15,120, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\wfr.ico")
GUICtrlSetTip(-1,"Web Filtering requests")
GUICtrlSetOnEvent(-1, "WFR")
GUICtrlCreateLabel("Web Filtering", 60, 130,150,20)

;Web filtering
GUICtrlCreateButton("TKB", 15,160, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\tkb.ico")
GUICtrlSetTip(-1,"Tech Knowledge Base")
GUICtrlSetOnEvent(-1, "TKB")
GUICtrlCreateLabel("Tech Knowledge Base", 60, 170,150,20)

;ASSET MANAGEMENT
GUICtrlCreateButton("Asset", 15,200, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\asset.ico")
GUICtrlSetTip(-1,"Asset Management")
GUICtrlSetOnEvent(-1, "AM")
GUICtrlCreateLabel("Asset Management", 60, 210,150,20)

;STOCK CONTROL
GUICtrlCreateButton("STOCK", 15,240, 36,36, $BS_ICON)
GUICtrlSetImage (-1, $path & "\STOCK.ico")
GUICtrlSetTip(-1,"Stock Control")
GUICtrlSetOnEvent(-1, "Stock")
GUICtrlCreateLabel("Stock Control", 60, 250,150,20)







;search tab start
GUICtrlCreateTabItem("Search")
guictrlcreategroup("Google Search",10,70,330, 80)
guictrlcreatelabel("Search", 20, 92, 50, 20)
$search = guictrlcreateinput("Enter search item?", 80, 90, 200, 20, $ES_WANTRETURN)
GUICtrlCreateButton("Go", 290, 90, 40, 20)
GUICtrlSetOnEvent(-1, "googlesearch")
$resetg = GUICtrlCreateButton("Reset", 260, 120, 70, 20)
GUICtrlSetOnEvent($resetg, "resetgsearch")
GUICtrlSetState($resetg,$GUI_disable)


guictrlcreategroup("Google image Search",350,70,330, 80)
guictrlcreatelabel("Search", 360, 92, 50, 20)
$isearch = guictrlcreateinput("Enter image?", 420, 90, 200, 20, $ES_WANTRETURN)
GUICtrlCreateButton("Go", 630, 90, 40, 20)
GUICtrlSetOnEvent(-1, "googleisearch")
$reseti = GUICtrlCreateButton("Reset", 600, 120, 70, 20)
GUICtrlSetOnEvent($reseti, "resetisearch")
GUICtrlSetState($reseti,$GUI_disable)

if $firefox = 1 Then
$ffcb = GUICtrlCreateCheckbox("FireFox", 20, 120, 100, 20)
GUICtrlSetState(-1,$GUI_Checked)
$abcb = GUICtrlCreateCheckbox("Avant", 120, 120, 80, 20)
GUICtrlSetState(-1,$GUI_unChecked)
Else
$ffcb = GUICtrlCreateCheckbox("FireFox", 20, 120, 100, 20)
GUICtrlSetState(-1,$GUI_unChecked)
EndIf

if $avant = 1 Then
$abcb = GUICtrlCreateCheckbox("Avant", 120, 120, 80, 20)
GUICtrlSetState(-1,$GUI_Checked)
$ffcb = GUICtrlCreateCheckbox("FireFox", 20, 120, 100, 20)
GUICtrlSetState(-1,$GUI_unChecked)
Else
$abcb = GUICtrlCreateCheckbox("Avant", 120, 120, 80, 20)
GUICtrlSetState(-1,$GUI_unChecked)
EndIf

GUICtrlCreateButton("Save", 200, 120, 50, 20)
GUICtrlSetOnEvent(-1, "googleprefs")

GUICtrlCreateGroup("Yell.com Search", 10, 150, 330, 130)
guictrlcreatelabel("Search for what?", 20, 172, 120, 20)
$yellforwhat = guictrlcreateinput("", 150, 170, 180, 20, $ES_WANTRETURN)
guictrlcreatelabel("or named who?", 20, 197, 120, 20)
$yellforwho = guictrlcreateinput("", 150, 195, 180, 20, $ES_WANTRETURN)
guictrlcreatelabel("in location?", 20, 222, 120, 20)
$yellforwhere = guictrlcreateinput("", 150, 220, 180, 20, $ES_WANTRETURN)
GUICtrlCreateButton("Search", 270, 250, 60, 20)
GUICtrlSetOnEvent(-1, "yellsearch")
$resety = GUICtrlCreateButton("Reset", 200, 250, 70, 20)
GUICtrlSetOnEvent($resety, "resetysearch")
GUICtrlSetState($resety,$GUI_disable)
;search tab end

;servers tab
GUICtrlCreateTabItem("Servers")

guictrlcreategroup("CCHS RM Servers", 10, 70, 250, 85)

GUICtrlCreateLabel("CHS-SR-001", 20, 90, 150, 20)
$pingchs1 = ping("chs-sr-001", 250)
    if $pingchs1 Then
        $chs1 = guictrlcreatelabel("OK", 160, 90, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $chs1 = guictrlcreatelabel("OFFLINE", 160, 90, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
    
GUICtrlCreateLabel("CHS-SR-002", 20, 110, 150, 20)
$pingchs2 = ping("chs-sr-002", 250)
    if $pingchs2 Then
        $chs2 = guictrlcreatelabel("OK", 160, 110, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $chs2 = guictrlcreatelabel("OFFLINE", 160, 110, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf

GUICtrlCreateLabel("CHS-SR-003", 20, 130, 150, 20)
$pingchs3 = ping("chs-sr-003", 250)
    if $pingchs3 Then
        $chs3 = guictrlcreatelabel("OK", 160, 130, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $chs3 = guictrlcreatelabel("OFFLINE", 160, 130, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf

guictrlcreategroup("Core Servers", 10, 160, 250, 125)
GUICtrlCreateLabel("CCHS Facility", 20, 180, 150, 20)
$pingfac = ping("facility", 250)
    if $pingfac Then
        $fac = guictrlcreatelabel("OK", 160, 180, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $fac = guictrlcreatelabel("OFFLINE", 160, 180, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
    
GUICtrlCreateLabel("CCHS Intranet", 20, 200, 150, 20)
$pingint = ping("cchs-intranet", 250)
    if $pingint Then
        $int = guictrlcreatelabel("OK", 160, 200, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $int = guictrlcreatelabel("OFFLINE", 160, 200, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
GUICtrlCreateLabel("CCHS Print", 20, 220, 150, 20)
$pingpri = ping("CCHSprint", 250)
    if $pingpri Then
        $pri = guictrlcreatelabel("OK", 160, 220, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $pri = guictrlcreatelabel("OFFLINE", 160, 220, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf


GUICtrlCreateLabel("CCHS TS002", 20, 240, 150, 20)
$pingts2 = ping("cchsts002", 250)
    if $pingts2 Then
        $ts2 = guictrlcreatelabel("OK", 160, 240, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $ts2 = guictrlcreatelabel("OFFLINE", 160, 240, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
    
GUICtrlCreateLabel("CCHS Backup", 20, 260, 150, 20)
$pingbac = ping("cchsbackup", 250)
    if $pingbac Then
        $bac = guictrlcreatelabel("OK", 160, 260, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $bac = guictrlcreatelabel("OFFLINE", 160, 260, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf

guictrlcreategroup("Old Network", 10, 290, 250, 65)
GUICtrlCreateLabel("SERVER1", 20, 310, 150, 20)
$pingser1 = ping("SERVER1", 250)
    if $pingser1 Then
        $ser1 = guictrlcreatelabel("OK", 160, 310, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $ser1 = guictrlcreatelabel("OFFLINE", 160, 310, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
    
GUICtrlCreateLabel("SERVER2", 20, 330, 150, 20)
$pingser2 = ping("SERVER2", 250)
    if $pingser2 Then
        $ser2 = guictrlcreatelabel("OK", 160, 330, 100, 20)
        GUICtrlSetColor(-1, "0x00C000")
    Else
        $ser2 = guictrlcreatelabel("OFFLINE", 160, 330, 100, 20)
        GUICtrlSetColor(-1, "0xff0000")
    EndIf

Guictrlcreategroup("Ping Tool", 270, 70, 415, 285)
GUICtrlCreateLabel("Target", 280, 90, 60, 20)
$tping = guictrlcreateinput("", 350, 90, 280, 20)
guictrlcreatebutton("Ping", 635, 90, 40, 20)
GUICtrlSetOnEvent($tping, "tping")

$pingop = GUICtrlCreateEdit("", 280, 120, 395, 225, $ES_MULTILINE+$ES_WANTRETURN)
$resetp = GUICTRLCREATEBUTTON("Reset", 625,360,60,20)
GUICtrlSetState($resetp,$GUI_disable)
GUICtrlSetOnEvent(-1, "resetp")


GUICTRLCREATEBUTTON("Re Ping", 20,360,100,20)
GUICtrlSetOnEvent(-1, "reping")

$mapc = GUICTRLCREATEBUTTON("Map C$", 540,360,80,20)
GUICtrlSetState($mapc,$GUI_disable)
GUICtrlSetOnEvent(-1, "mapc")



GUICtrlCreateTabItem("Calender")

GUICtrlCreateMonthcal($date, 10, 70, 300, 250,  $MCS_WEEKNUMBERS)

;functions


func tping()
$target = guictrlread($tping)   
$testping = ping($target, 250)
if $testping then 
guictrlsetdata($pingop, "", "")
$file = @tempdir & $target & ".tmp"
    if $target = "" then 
        msgbox(48,"No target!", "No target input", 5)
    Else
        Runwait(@ComSpec & " /c " & 'ping ' & $target & '>>' & $file, "", @SW_hide)
        sleep(500)
        $CountLines = _FileCountLines($file)
$i = 3
do
    $pingread = stringstripws(filereadline($file, $i),1)
    if $pingread = "" Then
    guictrlsetdata($pingop, @CRLF, @CR)
    else        
    guictrlsetdata($pingop, $pingread & @CR,@CR)
    endif
    $i = $i + 1
until $i = $CountLines
fileclose($file)
FileDelete($file)
EndIf
GUICtrlSetState($resetp,$GUI_enable)
GUICtrlSetState($mapc,$GUI_enable)
Else
    msgbox(48, "Warning!", "Host not found, or Machine is not responding to pings!", 5)
    guictrlsetdata($tping, "", "")
endif
EndFunc

func mapc()
    $target = guictrlread($tping)   
    $drive = "\\" & $target & "\c$"
    drivemapadd("*", $drive, 8)
endfunc

func resetp()
    guictrlsetdata($pingop, "", "")
    guictrlsetdata($tping, "", "")
    GUICtrlSetState($resetp,$GUI_disable)
    GUICtrlSetState($mapc,$GUI_disable)
EndFunc



func reping()
guictrlsetdata($chs1, "", "")
guictrlsetdata($chs2, "", "")
guictrlsetdata($chs3, "", "")
guictrlsetdata($fac, "", "")
guictrlsetdata($int, "", "")
guictrlsetdata($pri, "", "")
guictrlsetdata($ts2, "", "")
guictrlsetdata($bac, "", "")
guictrlsetdata($ser1, "", "")
guictrlsetdata($ser2, "", "")
sleep(1000)             

$pingchs1 = ping("chs-sr-001", 250)
    if $pingchs1 Then
        guictrlsetdata($chs1, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($chs1, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingchs2 = ping("chs-sr-002", 250)
    if $pingchs2 Then
        guictrlsetdata($chs2, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($chs2, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingchs3 = ping("chs-sr-003", 250)
    if $pingchs3 Then
        guictrlsetdata($chs3, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($chs3, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingfac = ping("facility", 250)
    if $pingchs1 Then
        guictrlsetdata($fac, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($fac, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingint = ping("cchs-intranet", 250)
    if $pingint Then
        guictrlsetdata($int, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($int, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingpri = ping("cchsprint", 250)
    if $pingpri Then
        guictrlsetdata($pri, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($pri, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingts2 = ping("cchsts002", 250)
    if $pingts2 Then
        guictrlsetdata($ts2, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($ts2, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingbac = ping("cchsbackup", 250)
    if $pingbac Then
        guictrlsetdata($bac, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($bac, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingser1 = ping("server1", 250)
    if $pingser1 Then
        guictrlsetdata($ser1, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($ser1, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf
sleep(500)

$pingser2 = ping("server2", 250)
    if $pingser2 Then
        guictrlsetdata($ser2, "OK", "")
        GUICtrlSetColor(-1, "0x00C000")
    Else
        guictrlsetdata($ser2, "OFFLINE", "")
        GUICtrlSetColor(-1, "0xff0000")
    EndIf

ENDFUNC



Func stock()
    if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://cchs-intranet/stock", "", @SW_MAXIMIZE)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://cchs-intranet/stock", "", @SW_MAXIMIZE)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://cchs-intranet/stock", "", @SW_MAXIMIZE)
        EndIf
EndFunc

Func am()
    if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://cchs-intranet/asset", "", @SW_MAXIMIZE)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://cchs-intranet/asset", "", @SW_MAXIMIZE)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://cchs-intranet/asset", "", @SW_MAXIMIZE)
        EndIf
EndFunc


Func tkb()
    if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://cchs-intranet/tkb", "", @SW_MAXIMIZE)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://cchs-intranet/tkb", "", @SW_MAXIMIZE)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://cchs-intranet/tkb", "", @SW_MAXIMIZE)
        EndIf
EndFunc

Func wfr()
    if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://cchs-intranet/filtering", "", @SW_MAXIMIZE)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://cchs-intranet/filtering", "", @SW_MAXIMIZE)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://cchs-intranet/filtering", "", @SW_MAXIMIZE)
        EndIf
EndFunc

Func helpdesk()
    if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://cchs-intranet/helpdesk_new", "", @SW_MAXIMIZE)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://cchs-intranet/helpdesk_new", "", @SW_MAXIMIZE)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://cchs-intranet/helpdesk_new", "", @SW_MAXIMIZE)
        EndIf
EndFunc







Func rmaudi()
    run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  https://chs-sr-001/auditor/", "", @SW_MAXIMIZE)
EndFunc


Func rmrema()
    if not FileExists("C:\Program Files\Radmin\radmin.exe") Then
        msgbox(48, "Warning!", "RM Remote Admin not installed on this workstation", 10)
    Else
        run("C:\Program Files\Radmin\radmin.exe", "")
    EndIf
EndFunc


Func rmmanc()
    run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  https://chs-sr-003/manage", "", @SW_hide)
EndFunc


func yellsearch()
            if guictrlread($ffcb) = 1 Then
            run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.yell.com/ucs/UcsSearchAction.do?keywords=" & Guictrlread($yellforwhat) & "&companyName=" & Guictrlread($yellforwho) & "&location=" & Guictrlread($yellforwhere) & "&searchType=classic&Submit.x=32&Submit.y=14"  , "", @SW_MAXIMIZE)
            GUICtrlSetState($resety, $GUI_enable)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://www.yell.com/ucs/UcsSearchAction.do?keywords=" & Guictrlread($yellforwhat) & "&companyName=" & Guictrlread($yellforwho) & "&location=" & Guictrlread($yellforwhere) & "&searchType=classic&Submit.x=32&Submit.y=14"  , "", @SW_MAXIMIZE)
            GUICtrlSetState($resety, $GUI_enable)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://www.yell.com/ucs/UcsSearchAction.do?keywords=" & Guictrlread($yellforwhat) & "&companyName=" & Guictrlread($yellforwho) & "&location=" & Guictrlread($yellforwhere) & "&searchType=classic&Submit.x=32&Submit.y=14"  , "", @SW_MAXIMIZE)
            GUICtrlSetState($resety, $GUI_enable)
        EndIf
    
EndFunc

func resetysearch()
    guictrlsetdata($yellforwhat, "", "")
    guictrlsetdata($yellforwho, "", "")
    guictrlsetdata($yellforwhere, "", "")
    GUICtrlSetState($resety,$GUI_disable)
EndFunc

func resetgsearch()
    guictrlsetdata($search, "", "")
    GUICtrlSetState($resetg,$GUI_disable)
EndFunc

func resetisearch()
    guictrlsetdata($isearch, "", "")
    GUICtrlSetState($reseti,$GUI_disable)
EndFunc

Func SpecialEvents()
    Select
        Case @GUI_CTRLID = $GUI_EVENT_CLOSE
            Exit
        Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE
        EndSelect
EndFunc

func googleprefs()
    if guictrlread($ffcb) = 1 then 
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "1")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "0")
    Elseif guictrlread($abcb) = 1 then 
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "1")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "0")
    else
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "0")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "0")
    EndIf
    
    if guictrlread($ffcb) = 1 then 
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "1")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "0")
    Elseif guictrlread($abcb) = 1 then 
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "1")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "0")
    else
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "avant", "REG_SZ", "0")
        regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCHS\admin tools\", "firefox", "REG_SZ", "0")
    EndIf
    
EndFunc

func googleisearch()
    if Guictrlread($isearch) = "Enter image?" or  Guictrlread($isearch) = "" then
        msgbox(64, "No search", "no search citeria entered!", 5)
        Else
        if guictrlread($ffcb) = 1 Then
            $m = run("C:\Program Files\Mozilla Firefox\firefox.exe http://images.google.ca/images?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($isearch) , "", @SW_MAXIMIZE)
            GUICtrlSetState($reseti, $GUI_enable)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://images.google.ca/images?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($isearch), "", @SW_MAXIMIZE)
            GUICtrlSetState($reseti, $GUI_enable)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://images.google.ca/images?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($isearch), "", @SW_MAXIMIZE)
            GUICtrlSetState($reseti, $GUI_enable)
        EndIf
    EndIf
EndFunc     

func googlesearch()
    if Guictrlread($search) = "Enter search item?" or  Guictrlread($search) = "" then
        msgbox(64, "No search", "no search citeria entered!", 5)
        Else
        if guictrlread($ffcb) = 1 Then
            $m = run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.google.co.uk/search?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($search) , "", @SW_MAXIMIZE)
            GUICtrlSetState($resetg, $GUI_enable)
        ElseIf  guictrlread($abcb) = 1 Then
            run("C:\Program Files\Avant Browser\avant.exe http://www.google.co.uk/search?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($search), "", @SW_MAXIMIZE)
            GUICtrlSetState($resetg, $GUI_enable)
        Else
            run("C:\Program Files\Internet Explorer\IEXPLORE.EXE  http://www.google.co.uk/search?ie=UTF-8&oe=UTF-8&q=" & Guictrlread($search), "", @SW_MAXIMIZE)
            GUICtrlSetState($resetg, $GUI_enable)
        EndIf
    EndIf
EndFunc

;end functions

GuiSetState()
While 1
    sleep(200)
WEnd
Exit

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



I guess i'm not the only one who does this line of work then, thanks for the tip off, he has some ideas i'd never thought of using .... cool :think:


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

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