Sign in to follow this  
Followers 0
MartinP

Beginners Problem with Execution von Windows Server 2008

3 posts in this topic

Hi,

I try to keep a data connection alive using autoit. A script working perfectly on a normal PC should do the same task on a Server Windows 2008. The script regularly tries a login on website and has to kill some applications (windows) when the connection is lost and has to be reastablished again.

As mentioned. The script works fine on Windows Vista. As long as the Server has a screen via Remote Desktop it works fine as well. As soon as the script works without a Remote Desktop Session (with all the windows) it fails.

Is there anything I have to consider?

Thanks

Martin

Share this post


Link to post
Share on other sites



Welcome to the forum.

Hi,

I try to keep a data connection alive using autoit. A script working perfectly on a normal PC should do the same task on a Server Windows 2008. The script regularly tries a login on website and has to kill some applications (windows) when the connection is lost and has to be reastablished again.

As mentioned. The script works fine on Windows Vista. As long as the Server has a screen via Remote Desktop it works fine as well. As soon as the script works without a Remote Desktop Session (with all the windows) it fails.

Is there anything I have to consider?

Yes: Post the code you are talking about :)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Welcome to the forum.

Yes: Post the code you are talking about :)

Regards, Rudi.

Here is the code where I suppose something goes wrong

Func _KillPopupBeforeLogin()

; ***********************

_WriteLog ( 1, "Anfang _KillPopupBeforeLogin() fuer $login_handle " & $login_handle)

local $var = WinList()

local $i

local $ret

local $lastresentwindow = WinGetHandle("")

if WinGetTitle($lastresentwindow) = "" then

_WriteLog ( 1, "Anfang _KillPopupBeforeLogin 1")

; direkt vor dieser Funktion wurde der Login gestartet: wenn nun das gerade aktive

; Window keinen Titel hat, müsste es das "Neue Version" Popup sein

; Wir lassen das IB Popup "New Version" kurz stehen:

sleep( $new_version_wait_sec * 1000) ; sleep funzt mit Millisekunden

WinKill($lastresentwindow)

Else

; falls der User dummerweise dazwischengeklickt hat, versuchen wir es mit dem Windows-Parent;

; leider wird das "Neue Version" Popup von IB meist abgekoppelt vom Login window. Also diese

; zweite Chance funktioniert nur, wenn das Parent bekannt ist ..

For $i = 1 to $var[0][0]

_WriteLog ( 1, "Anfang _KillPopupBeforeLogin 2")

$ret = _WinGetParent( $var[$i][1])

If $ret = 0 Then

_WriteLog ( 1, "_KillPopupBeforeLogin _WinGetParent->Error" & $ret & " Paramerter " & $var[$i][1])

EndIf

if $ret == $login_handle and $var[$i][1] <> $login_handle and $var[$i][0] <> "Default IME" Then

_WriteLog ( 1, "Anfang _KillPopupBeforeLogin 3")

; Wir lassen das IB Popup "New Version" kurz stehen:

sleep( $new_version_wait_sec * 1000) ; sleep funzt mit Millisekunden

WinClose($var[$i][1]) ; und räumen es dann ab

_WriteLog ( 1, "Vor dem Login musste ein Popup (" & $var[$i][0] & ") abgeräumt werden: vielleicht gibt es eine neue TWS Version!" )

EndIf

; if _WinGetParent( $var[$i][1]) == $login_handle and $var[$i][1] <> $login_handle and $var[$i][0] <> "Default IME" Then

; ; Wir lassen das IB Popup "New Version" kurz stehen:

; sleep( $new_version_wait_sec * 1000) ; sleep funzt mit Millisekunden

; WinClose($var[$i][1]) ; und räumen es dann ab

; _WriteLog ( 1, "Vor dem Login musste ein Popup (" & $var[$i][0] & ") abgeräumt werden: vielleicht gibt es eine neue TWS Version!" )

; EndIf

Next

endif

EndFunc

Regards

Martin

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