Sign in to follow this  
Followers 0
drpatso

handle file download while workstation locked

13 posts in this topic

I have read several threads about this and nothing seems to be successful...

WinWait("File Download")

Sleep (400)

WinExists("File Download")

sleep (400)

ControlClick("File Download", "Do you want to save this file, or find a program online to open it?", "&Save")

sleep (400)

WinExists("Save As")

ControlClick("Save As" , "" , "&Save")

sleep (400)

ControlClick("Save As" , "" , "&Yes")

WinExists("Download complete")

Sleep (400)

ControlClick("Download complete" , "", "Close")

I have the whole code compiled as an EXEwhen I log back in the File Download window is open.... it's not handling it.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks John,

I thought I did write code that works while locked by using the ControlClick command... While locked it doesn't seem to be finding the File Download window... is it just going too fast and WinWait isn't working while it is locked?

Edited by drpatso

Share this post


Link to post
Share on other sites

ya, it does work well, and the script will pause until File Download pops up....

You're right I probably don't need the WinExists..

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I did just discover the original "click" doesn't actually push the button while locked since the window is not active, it just highlights the save buton..... it's similar to if you are logged in and you click save and the window is not active, it just highlights the save button and makes the window active...

Edited by drpatso

Share this post


Link to post
Share on other sites

I can only assume then that the window needs to be active to accept input, and that is something you cannot achieve on a locked workstation.

You should add some debugging to see exactly where it is faulting, few consolewrites ought to do it.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

ah crap, thanks John that makes sense. It is an IE file download popup, probably has loads of security measures to not allow input while window is not active like you say... Maybe I would have better luck with firefox.

Share this post


Link to post
Share on other sites

nah, it's a jreports type CSV.. I need to be logged in and it uses a session ID and creates the file. It gets to a page and continues to refresh until the server has it ready then the file download finally pops up...

Share this post


Link to post
Share on other sites

I solved this by just having a windows 7 virtual machine on our esxi server that never logs out... silly to troubleshoot scripts while logged out, with VMs being so easy.

Share this post


Link to post
Share on other sites

Other way would be downloading directly by command without controlling any windows.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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