Jump to content
Sign in to follow this  
drpatso

handle file download while workstation locked

Recommended Posts

drpatso

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
drpatso

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
JohnOne

What exactly do you think this line will do?

WinExists("File Download")

you do not test it in any fashion.

Are you saying that the code you provided works stable while the workstation is not locked?


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
drpatso

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
drpatso

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
JohnOne

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
drpatso

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
drpatso

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
drpatso

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
Xenobiologist

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.