Sign in to follow this  
Followers 0
rudi

Win2k3 Enterprise Server: AT Scheduled script can't interact with GUI?

9 posts in this topic

Hi.

(btw: When started by "doubleclicking", everything works fine.)

On an Windows 2003 Enterprise Server the ERP system is stopped for DB dump purposes. After that's done, the Oracle Shared Memory Server is started again.

If there is session info in the Ora Shared Memory, a dialog box is popping up asking if it shall be cleared or not. It SHALL be cleared, but this only works, when the autoit script was not started from the Win Task Scheduler ("AT 14:45 ....")

" /Interactive" doesn't help either.

There is always a user loggedon, may be the console login is locked, or not. This User "BAAN" is also used for Scheduler tasks.

#include <date.au3>

$logfile=@ScriptDir & "\SharedMemClickWeg.log"
Opt("TrayAutoPause", 0)

$i = 1
While 1
    If WinWait("Shared Memory Service", "The shared memory server did", 1) Then
        MsgBox(0,"Erkannt","Fenster erkannt",3)
        WinActivate("Shared Memory Service", "The shared memory server did")
        MsgBox(0,"Erkannt","Fenster aktiviert",3)
        Sleep(100)
        ControlClick("Shared Memory Service", "The shared memory server did", "Button1")
        MsgBox(0,"Erkannt","Button 1 (OK) geklickt",3)
        FileWriteLine($logfile, _Now() & ": Shared Mem gecleared")
        Exit
    Else
        MsgBox(48,"Nicht Erkannt","Warte weiter",3)
        Sleep(1000)
    EndIf
    $i += 1
    If $i > 30 Then
        FileWriteLine($logfile, _Now() & ": TimeOut (Shared Mem geclearing nicht notwendig)")
        Exit
    EndIf
WEnd

When started from the Scheduler using the same user account the current logon is running from none of the MsgBoxes show up.

How to allow the scheduler started script to interact with the GUI of the current logon?

Or maybe someone knows an option to tell the Ora Shared Mem Service to clear without that dialog box?

Regards, Rudi.


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

Share this post


Link to post
Share on other sites



Hi Rudi,

If you use the AutoIt Window Info program, what details are collected? can you post a summary of the text shown when this issue arrises?


Perilous to all of us are the devices of an art deeper than we ourselves possess.

Share this post


Link to post
Share on other sites

@rudi

A simple way to avoid this, is not to stop the Shared Memory service for making a dump of the Oracle DB.

Just stop the "Baan DB" Service and the "Baan Application" service and make the dump files.

This way you will get rid of the popup window.

regards,

ptrex

Share this post


Link to post
Share on other sites

Hi.

@rudi

A simple way to avoid this, is not to stop the Shared Memory service for making a dump of the Oracle DB.

Just stop the "Baan DB" Service and the "Baan Application" service and make the dump files.

This way you will get rid of the popup window.

@ptrex

The people from baan told us, that this stopping and restarting the shared mem svc is a REQUIRED procedure to ensure, that no old sessions might survive the DB dump -- that's nonsense?

Anyways, is it generally impossible to interact with a GUI for Autoit scripts launched as an AT scheduled task?

Regards, Rudi.


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

Share this post


Link to post
Share on other sites

Hi Rudi,

If you use the AutoIt Window Info program, what details are collected? can you post a summary of the text shown when this issue arrises?

The autoit window info tool, started from the current logon, is presenting exactly what the AT scheduled script is waiting for. The AT scheduled script seems not to see ANY window in the currently running GUI logon session. Also when I add a simple

Msgbox(0,"Box","Output from AT scheduled script",5)

no msgbox is showing up. So I guess that AT scheduled scripts have a general problem to "see" windows of the current logon and to interact with the GUI of the current logon.

Regards, Rudi.


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

Share this post


Link to post
Share on other sites

The autoit window info tool, started from the current logon, is presenting exactly what the AT scheduled script is waiting for. The AT scheduled script seems not to see ANY window in the currently running GUI logon session. Also when I add a simple

Msgbox(0,"Box","Output from AT scheduled script",5)

no msgbox is showing up. So I guess that AT scheduled scripts have a general problem to "see" windows of the current logon and to interact with the GUI of the current logon.

Regards, Rudi.

Ok, is it possible to have a schedule Autoit code launch the process, and attempt it that way?

Just to clarify, is your code function correctly when double clicked, but not when published to work from a user account?

Is the Oracle progam running is any form of vertial machine?


Perilous to all of us are the devices of an art deeper than we ourselves possess.

Share this post


Link to post
Share on other sites

Ok, is it possible to have a schedule Autoit code launch the process, and attempt it that way?

Just to clarify, is your code function correctly when double clicked, but not when published to work from a user account?

Yes, it is. When the AT scheduled shows up in taskmgr and does *NOT* "see" the window, I can start the same program by adoubleclick, and it will work fine.

Is the Oracle progam running is any form of vertial machine?

What's a "verital" machine? (http://dict.leo.org/ doesn't offer any translations for "vertal" muttley )

Regards, Rudi.


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

Share this post


Link to post
Share on other sites

@rudi

He means VIRTUAL Machine instead of verital ?!

Anyhow this is a way to avoid your problem.

First stop these services

net stop "BaanLicencing" /Y
net stop "BaanLogicService" /Y

Then run the Dump command.

d:\baan\bin\bdbpre.exe -t "^A" -o e:\export\cmp000 -I tables -E e:\export\cmp000\exp000.err -C 000
d:\baan\bin\bdbpre.exe -O e:\export\cmp000\dump.000 -I tables -E e:\export\cmp000\dump000.err -C 000

Best to do this in a weekend when no users are still working.

Regards,

ptrex

Share this post


Link to post
Share on other sites

He means VIRTUAL Machine instead of verital ?!

I thought so, too, but verital is quite far away from virtual, and I don't know too many vocabularies, especially slang muttley

Anyhow this is a way to avoid your problem.

First stop these services

net stop "BaanLicencing" /Y
net stop "BaanLogicService" /Y

Then run the Dump command.

d:\baan\bin\bdbpre.exe -t "^A" -o e:\export\cmp000 -I tables -E e:\export\cmp000\exp000.err -C 000
d:\baan\bin\bdbpre.exe -O e:\export\cmp000\dump.000 -I tables -E e:\export\cmp000\dump000.err -C 000
And you are sure, that it's not REQUIRED to stop / start the shared memory server as well?

I was wondering, if there might be some start service switch or registry key to specify "Clear it without asking questions", but couldn't google any good results.

Regards, Rudi.


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

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