Sign in to follow this  
Followers 0
amfony

how to output results from login script ...

6 posts in this topic

Hi guys,

I have made a login script that does a few things, map drives, closest printer, set resolution based on computer name/model, set time, set loggedOn flag blah blah ... it works so i am happy with that but i would REALLY like ti be able to output results of the script whilst it runs to the user.

for example in a command prompt-esque black window have text like:

"

Good <Morning/Afternoon> <DisplayName>

<Domain> login script is currently running, please be patient and pay attention to any errors.

Drives mapping ... Done

Printer mapping ... Done

Resolution ... Reset

If error displayed please contact IT."

Now i know this is doable in Kix - whilst i have never ever used kix (and dont want to - i like autoIt) would this doable in autoit?

If not in a command prompt-esque window - how else could i inform users to script progress?

Thanks alot guys - i know this is a simple question for you guys im just a lost.

Share this post


Link to post
Share on other sites



Hmm. Using a gui window and updating a label or read only edit box would be good, or some splash screens even. If you really wanted to use the console though, you could try something like this:

#include <File.au3>
opt("WinTitleMatchMode",4)

UpdateConsole("Running first command")

; Do whatever
Run(@ComSpec & " /k foo.bat",@ScriptDir)
sleep(2000)
; Do whatever
UpdateConsole("Running next command")
WinActivate("[CLASS:ConsoleWindowClass]")
Send("{ENTER}")
sleep(2000)
; Do Whatever
UpdateConsole("Running another...")
WinActivate("[CLASS:ConsoleWindowClass]")
Send("{ENTER}")
sleep(2000)
; Do whatever
UpdateConsole("Error, please contact Administrator")
WinActivate("[CLASS:ConsoleWindowClass]")
Send("{ENTER}")
sleep(2000)

WinClose("[CLASS:ConsoleWindowClass]")

Func UpdateConsole($str)
    $f = FileOpen("output.log",2)
    FileWriteLine($f,$str)  
    FileClose($f)
EndFunc

Share this post


Link to post
Share on other sites

Thanks alot guys - i know this is a simple question for you guys im just a lost.

have a look at the help file sample of SplashTextOn(). That will give you an idea how to start...

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
Sleep(3000)
SplashOff()

;; SMOOTH
$message = ""
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
    $message = $message & $x & @LF
    ControlSetText("TitleFoo", "", "Static1", $message)
    sleep(100)
Next

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

hi guys - thanks for the quick replies i was able to use splashtextOn() for what i needed in a simple way. Id like to colourise it - however i think thats outiside the scope of splashTextOn().

Funny i even thought about splashImage() but i must have totally skipped splashText()!! Sorry for being a dud.

Thanks alot agian.

Share this post


Link to post
Share on other sites

Sorry - just going on about how i wanted to colour the splashText() any ideas?

Share this post


Link to post
Share on other sites

Hi guys,

I have made a login script that does a few things, map drives, closest printer, set resolution based on computer name/model, set time, set loggedOn flag blah blah ... it works so i am happy with that but i would REALLY like ti be able to output results of the script whilst it runs to the user.

for example in a command prompt-esque black window have text like:

"

Good <Morning/Afternoon> <DisplayName>

<Domain> login script is currently running, please be patient and pay attention to any errors.

Drives mapping ... Done

Printer mapping ... Done

Resolution ... Reset

If error displayed please contact IT."

Now i know this is doable in Kix - whilst i have never ever used kix (and dont want to - i like autoIt) would this doable in autoit?

If not in a command prompt-esque window - how else could i inform users to script progress?

Thanks alot guys - i know this is a simple question for you guys im just a lost.

Could you show the commands you use in AutoIT to map printers etc?

Because i am currently using KIX, but i want to use AutoIT because you can make it more colourfull and professional then a simple batch file.

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