Sign in to follow this  
Followers 0
peter-n

Scheduled task when no login. "text" data blank?

2 posts in this topic

#1 ·  Posted (edited)

I have an AutoIT V3 script that downloads a bunch of data nightly using multiple RAdmin file transfers, on a Microsoft 2003 Server host.

(Yes, I am careful to avoid WinActivate(), Send(), etc and all the things that don't work when a real desktop is not active. P.S. TrayTip() also causes locking in that situation, which was a bit of a surprise...)

So:

It runs fine when run manually on a desktop,

It runs fine if the task-owner has ANY desktop logged in anywhere (As you may know, Server 2003 has some limited multiple-desktop support, I think it is max of 2 remote + 1 console login, or something like that...)

Problem is: if NO login is active, my script fails (it stops at a point), and I have tracked down the reason:

While the windows DO come up, and are detectable with WinWait("Some Title"), the windows NEVER seem to have any gleanable 'text' on them. When I say 'text', I mean the stuff often used as second parameter on many Win*() functions. I can use WinList() and a debug dump to demonstrate this.

Since I am using multiple windows (refer para 1 above), I need to be able to get the 'text' so that I can pick which window to operate on. I also need the text to know where the download process is at... And when it's finished.

Can anyone offer a solution such that AutoIT V3 can get at text in windows in this state?

Perhaps the windows/controls are not 'painting/configuring' themselves since they never really become active/shown if there is no desktop???

I have tried calling WinActivate(), WinSetState(..., @SW_ENABLE), WinSetState(..., @SW_SHOW), all to no avail.

I really want to get this working. It needs to run daily and very reliably, so I don't want to need an active login for it to work...

Any tips much appreciated.

(P.S. Amazing tool Jonathan, if you read this, Cheers.)

Edited by peter-n

Share this post


Link to post
Share on other sites



It's OK, I figured it out myself.

This does the trick:

Opt("WinDetectHiddenText", 1)

Sheesh - This must have been a hard one - zero replies with help!

Anyway, there you go. If you are writing AutoIT scripts to run from scheduled tasks, you might find that setting this helps a LOT for Window control... If you need to use the 'text' parameter of Win*() functions, etc.

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