Sign in to follow this  
Followers 0
tutui

Problems with starting script as a scheduled task

8 posts in this topic

Hi,

well, I have a application running on a server. Unfortunatly this application is not really stable (I didn't hacked it, I'm justing trying to give it a workaround, because the developer in question does not have any time to fix the problem). So this application has a window which is opened when it works. There is a "close" and a "cancel" button on that window. What I want to do now, is to use autoit to get the focus on the window and click on the "close" button once in a day. After that i want to restart the application. As i mentioned it in the topic title, I will define a scheduled task to recycle the application. Hope you can follow me... I know, there is a easy script solution to that problem using a little kille application, but I can use that because the application has to be closed properly. So I wanted to do that job with autoit...

I converted the autoit script to an .exe file. If I now start the .exe file manually everything works fine. But when i lock the account on the server and close my remote session, the .exe file will not do the work. If I login once again on the server, the .exe file will automatically starte his execution...

Has anyone an idea how to deal with this issue?

Here is the little script:

WinActivate("vitoMailCheck", "")

WinWaitActive("vitoMailCheck")

Sleep(1000)

Send("{ENTER}")

Sleep(1000)

Run("vitoMailCheck.exe")

Sleep(1000)

Thanks.

Regards,

tutui.

Share this post


Link to post
Share on other sites



Thanks for your reply.

Are you sure that there isn't any possibility to deal with a locked account?

Well, I can't either use what you suggest, because when I close the application by simply closing the window the application recognize the close as kind of failure... so it will generate an error and will not be closed safely! I know this sounds a little strange... but as I wrote it above, this is really a little crap of an application... clicking on the "close" button will close the application safely, but clicking e.g. on the "x" at the top right of the window will causing the application to crash...

Other suggestions?

Thanks.

Share this post


Link to post
Share on other sites

Thanks again for your reply.

Well, how do I use the controlsend() or controlclick() functions? The window just habe a "cancel" button and a "close" button, but I can't control them with a shortcut (e.g."Alt+...") or something like that... the only way to control the two buttons is to use the "tab" to get to the button I want to click and hit "enter"... any suggestions?

Thanks.

Share this post


Link to post
Share on other sites

Ok, I got it... let me try it!

Acting like a newbie... :o sorry.

Share this post


Link to post
Share on other sites

I'm back...

Well I tried your suggestion with the ControlClick command, but it didn't work! Is there really no possibility to manage some windows when the account is locked? I still can't believe it... :o

Thanks.

use autoitwindowinfo to get the control of the button than

controlclick ("vitoMailCheck", "", "ID", "left", 1)

its worth trying :geek:

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