keithy Posted May 29, 2012 Posted May 29, 2012 (edited) I have written a script that uses "run" to fire up our ERP program (Navision), then WinWaitActive to wait until Nav fires up, then pokes keystrokes at the app to select some reports to print. It works fine if I "go" in Scite editor, but wont run as an .exe or as a Server2008 scheduled task, presumably because the Navision program is hidden, so Winwaitactive never gets triggered. Navision is running in task Manager in this situation. I would like this to run unattended overnight, so any pointers would be much appreciated. NB Apropo the forum rules : I am not attempting to de-complile or violate the terms of the licence for Navision here !! Edited May 29, 2012 by keithy
someone Posted May 29, 2012 Posted May 29, 2012 I've never run an exe from a scheduled task like your trying to do, so I could be way off, but... Can you use WinWait instead of WinWaitActive? When you say it, 'pokes' some keystrokes, is it using Send or ControlSend? ControlSend may still work, while I wouldn't expect Send to work at all. If you need to add text try controlsettext. Just a few ideas. If that doesn't work please post a reproducer (or your entire code if it isn't too large). While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
keithy Posted May 29, 2012 Author Posted May 29, 2012 Thanks for the feedback. I thought that I would need to use WinWaitActive to ensure that the application fires up OK. I am using send (because it looked the simplest way at the time !) , but I will have a look at ControlSend now. I may be back !
Zedna Posted May 29, 2012 Posted May 29, 2012 http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now