Jump to content

status messages while setting at a logon


nimexx
 Share

Recommended Posts

Im looking for some ideas on how to work around a problem we are having. We use symantecs ghost console to deploy images and run various tasks which means we can runs scripts and exes even when the PC is setting at a logon.

Ghost has the AI builder for scripts but its rather limited so we also use AutoIt scripts.

One of the problems Im seeing is that we really dont have a good way to see whether an autoit script was successfull or not without logging on to each PC which is something we try to avoid when doing many machines at the same time.

For example, sometimes when I run an script to copy files or set regsitry keys, it may work on some but not all the PCs. It isnt practical to log on to every pc and check them so Im trying to find a better way to know the script worked or if it needs rerun.

Is it possible to display something like a status message in an Autoit script while setting at a logon screen so I can see what where the script is at and if it doing what it needs to?

Edited by nimexx
Link to comment
Share on other sites

Im looking for some ideas on how to work around a problem we are having. We use symantecs ghost console to deploy images and run various tasks which means we can runs scripts and exes even when the PC is setting at a logon.

Ghost has the AI builder for scripts but its rather limited so we also use AutoIt scripts.

One of the problems Im seeing is that we really dont have a good way to see whether an autoit script was successfull or not without logging on to each PC which is something we try to avoid when doing many machines at the same time.

For example, sometimes when I run an script to copy files or set regsitry keys, it may work on some but not all the PCs. It isnt practical to log on to every pc and check them so Im trying to find a better way to know the script worked or if it needs rerun.

Is it possible to display something like a status message in an Autoit script while setting at a logon screen so I can see what where the script is at and if it doing what it needs to?

You might want to add some Sleep's to this

$TaskNum = 5; Number of tasks to do
    $BarTotal = 1; Dont edit its to do 1/$TaskNum
    $BarTotal /= $TaskNum
    $BarTotal *= 100
    $BarTask = 0
    $Bar = ProgressOn( "Loading...", "Loading...", "0 Percent", 0, 0)
    $FileCopy1 = 1; Replace 1 with something like FileCopy
    $BarTask += $BarTotal
    If $FileCopy1 = 0 Then
        ProgressSet( $BarTask, "Failed!")
    Else
        ProgressSet( $BarTask, $BarTask&" Percent")
    EndIf
    $FileCopy2 = 1; Replace 1 with something like FileCopy
    $BarTask += $BarTotal
    If $FileCopy2 = 0 Then
        ProgressSet( $BarTask, "Failed!")
    Else
        ProgressSet( $BarTask, $BarTask&" Percent")
    EndIf
    $FileCopy3 = 1; Replace 1 with something like FileCopy
    $BarTask += $BarTotal
    If $FileCopy3 = 0 Then
        ProgressSet( $BarTask, "Failed!")
    Else
        ProgressSet( $BarTask, $BarTask&" Percent")
    EndIf
    $FileCopy4 = 1; Replace 1 with something like FileCopy
    $BarTask += $BarTotal
    If $FileCopy4 = 0 Then
        ProgressSet( $BarTask, "Failed!")
    Else
        ProgressSet( $BarTask, $BarTask&" Percent")
    EndIf
    $FileCopy5 = 1; Replace 1 with something like FileCopy
    $BarTask += $BarTotal
    If $FileCopy5 = 0 Then
        ProgressSet( $BarTask, "Failed!")
    Else
        ProgressSet( $BarTask, $BarTask&" Percent")
    EndIf
Link to comment
Share on other sites

Func _Start()

$file = FileOpen("name.txt", 0)

$Message = FileReadLine($file)

FileClose($file)

$Ca = GUICreate("", 250, 46, -1, -1, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_WINDOWEDGE + $WS_EX_DLGMODALFRAME)

GUISetBkColor(0x000000, $Ca)

Global $Da = GUICtrlCreateLabel($Message, 23, -1, 250, 23)

GUICtrlCreateGraphic(-1, 1, 252, 45, $SS_SUNKEN)

GUICtrlSetColor(-1, 0XFFFFFF)

GUICtrlSetColor($Da, 0XFFFFFF)

GUICtrlSetFont($Da, "12", "50", "", "Palatino LinoType Italic")

GUICtrlCreateGraphic(1, 23, 250, 20)

GUICtrlSetColor(-1, 0x007F00)

GUISetState(@SW_SHOW)

_Update()

EndFunc

Func _Update()

$file = FileOpen("name.txt", 0)

$Message = FileReadLine($file)

FileClose($file)

GUICtrlSetData($Da, $Message)

EndFunc

This small bit of code should get you started, of course you need to add a few other trivial bits to close script, or whatever, and to rerun the _Update function ( which you can do many ways, I leave that up to you, what you also need is a dynamically updating "name.txt" file, which is very easy to do in your login script (batch file) using:

del /q "c:\scripts\name.txt" <whatever path name you choose

echo misc text here >> "c:\scripts\name.txt" <whatever text you want

then in next part of batch file repeat that function with new data, autoit script will reopen the file and see the new data and update it in the gui after each new area in your batch file.. I have a nice splash screen with active data, progress bars, and active script (batch) content being displayed during the entire login script that I am finishing up as we speak..Should be done soon....

Edited by Stealth111
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...