juergenriemer Posted February 7, 2014 Share Posted February 7, 2014 Hi, The following issue: I have a software that was nicely running on Windows 2003; we changed to Windows 2008 and the program still works however when starting it pops up an alert telling some driver is missing which is important for the functioning. Stupid thing is that the program only start doing its job after I click away this alert box. So, I wrote a little auto script to start the program and click away the alert: Run( "C:Program Files (x86)pathtoprogram.exe /start" ) WinWait( "Error Message", "Failed to Initialize the Driver." ) ControlClick("Error Message", "OK", "Button1") Works like a charm when I start it in my Windows session. Now my problem: I want to run the program as soon as the machine is started, so I created a scheduled task to run on startup and put the SysAdmin account. If I run the task auto script will run the program.exe (I can see it in the taskmanager) but the the alert is obviously not clicked away because the program doesn't do what it should do. Now of course there is no GUI I suppose if the machine is started but how would you deal with this kind of problem Thanks a lot Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2014 Share Posted February 7, 2014 I would address the driver problem myself. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 7, 2014 Author Share Posted February 7, 2014 I would address the driver problem myself. Hi JohnOne, Well that would be the best solution of course, however I am not really in a position (not so smart) to do that :/ I was hoping that someone had a similar problem and solved it somehow. Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2014 Share Posted February 7, 2014 Well you could use Runas function, but it would need the username and password of whatever account you run it as, which is not recommended. Perhaps if you give the exact error, someone might have had same issue and able to help. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 7, 2014 Author Share Posted February 7, 2014 I am in the right context... I use a scheduled task with creds from an admin account. But I guess the alert window will not be rendered thus auto can't click it away. As for the error message it says: ""Failed to Initialize the Adlib Express PDF Driver." it is an old version of Adlib Express Server that I run on a new OS and I don't want/can afford to upgrade to a newer version. Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2014 Share Posted February 7, 2014 I don't think such a script would need admin privileges. I don't know much about system administration, but is there not a common folder or something where you can install a script to run on all user accounts? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 7, 2014 Author Share Posted February 7, 2014 The script is execute perfectly and it also spawns the process, but the alert is not clicked away. Its a script that should run as soon as the machine is booted, this will happen unattended and without anyone logging in so I guess the alert window is not rendered at all. Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2014 Share Posted February 7, 2014 To be clear, are you saying the window does not exist in user context when a logon is complete? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 10, 2014 Author Share Posted February 10, 2014 Hi John, sorry for the late reply. To summarize: I have an auto script which opens the application executable and waits for an alert to appear to cick away.. if this happens everything works smoothly. I create a scheduled task to run this auto script at startup of the machine. I used the same account I tested the auto script. If I run this scheduled task this popup never shows up, hence is not clicked away and hence the application does never get into working mode. That is, it does not only not work when the machine is rebooted but also not if I am logged in to that machine with that account and right click the scheduled task and execute it manually. It seems any UI output is swallowed in that case. Link to comment Share on other sites More sharing options...
JohnOne Posted February 10, 2014 Share Posted February 10, 2014 What if you add shortcut to your exe in startup folder? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 10, 2014 Author Share Posted February 10, 2014 I tried this and it only works if I login with that account; not on startup of the machine :/ BTW: thanks for your endurance Link to comment Share on other sites More sharing options...
JohnOne Posted February 10, 2014 Share Posted February 10, 2014 Have you tried other methods of getting shut of it, like WinClose, winkill etc... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
BlackDawn187 Posted February 10, 2014 Share Posted February 10, 2014 Problem is as you mentioned, There is no error message displayed if nobody is logged in. Thus, Checking the error in the manner you're doing is pointless. Your whole script relies on the existence of a windows dialog being displayed. Perhaps there is a log being generated somewhere that you could read for such an error? Though you still wouldn't be able to bypass the error message. Link to comment Share on other sites More sharing options...
JohnOne Posted February 10, 2014 Share Posted February 10, 2014 Perhaps I'm still a little confused, you say the window cannot be clicked away? So there is a window there somewhere to be clicked away? If so, how are you sure about that? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 13, 2014 Author Share Posted February 13, 2014 Thanks for rubber ducking I solved the problem by killing the process that triggered the error message. Link to comment Share on other sites More sharing options...
jdelaney Posted February 13, 2014 Share Posted February 13, 2014 Seems you would want the task to trigger "At log on", and select Security options "Run whether user is logged on or not" IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
juergenriemer Posted February 17, 2014 Author Share Posted February 17, 2014 Seems you would want the task to trigger "At log on", and select Security options "Run whether user is logged on or not" HI jdelaney, The (still unresolved) issue is that I do not logon to the machine but rather simply start it so I (and obvioulsy autoit) don't "see" the alert box rendered in which case autoit would click it away. Link to comment Share on other sites More sharing options...
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