Jump to content

Run program 'behind' the Window XP logon screen?


Recommended Posts

I have created a AutoIt script. It runs nicely when I just start it manually. But if I schedule the script to run e.g. 2 hours from now and the Windows logon screen has appeared, then the AutoIt starts the program and the nothing else happens(?). If I then login (I'm currently not using any password for that, so I just click on my user) I can see the program (that AutoIt has opened) and if I 'click various places' on the screen (of the program I try to run) I might be lucky that AutoIt resumes to run. What do I need to do that make it work? ;)

Link to comment
Share on other sites

  • Moderators

I have created a AutoIt script. It runs nicely when I just start it manually. But if I schedule the script to run e.g. 2 hours from now and the Windows logon screen has appeared, then the AutoIt starts the program and the nothing else happens(?). If I then login (I'm currently not using any password for that, so I just click on my user) I can see the program (that AutoIt has opened) and if I 'click various places' on the screen (of the program I try to run) I might be lucky that AutoIt resumes to run. What do I need to do that make it work? ;)

Right... and we are supposed to tell you the correct way to do what with what code you've provided?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thank you for your replies. The AutoIt-script I'm trying to run fetches various information of the internet (stock quotes, stock list) during the night. So what I want to do is:

1) Wake computer from Standby/Hibernate

2) Run AutIt-script

3) Put computer back on Standby/Hibernate

The AutoIt-script that I have created so far looks like this:

Run("C:\Program Files\Hershey's TickeRank\tr.exe")
WinWaitActive("Hershey's TickeRank")
ControlFocus( "Hershey's TickeRank", "List Export", 58 )
Send("{ENTER}") 
Do
 $b = ControlCommand( "Hershey's TickeRank", "", 9, "IsEnabled", "" )
Until $b = 1
WinClose("Hershey's TickeRank")
WinWaitClose("Hershey's TickeRank")

Run("C:\Program Files\Wealth-Lab, Inc.\Wealth-Lab Developer 3.0\WealthLab.exe")
WinWaitActive("Wealth-Lab Developer 4.0")
Sleep(2000)
Send("^m") 
Send("{TAB}") 
Send("{DOWN}") 
Send("!a") 
WinWaitActive("Confirm", "Yes")
Send("y")
WinWaitActive("Wealth-Lab", "OK")
Send("{ENTER}")
Send("{ESC}")
Sleep(2000)
Send("^!x") 

RUN ("C:\Program Files\Wealth-Lab, Inc\Wealth-Lab Developer 3.0\IndexLab.exe")
WinWaitActive("Index-Lab for Wealth-Lab Developer 3.0")
Sleep(2000)
Send("{F9}") 
WinWaitActive("Index-Lab", "OK")
Send("{ENTER}")
WinClose("Index-Lab for Wealth-Lab Developer 3.0")
WinWaitClose("Index-Lab for Wealth-Lab Developer 3.0")

Run("C:\Program Files\Wealth-Lab, Inc.\Wealth-Lab Developer 3.0\WealthLab.exe")
WinWaitActive("Wealth-Lab Developer 4.0")
Sleep(2000)
Send("^o") 
Send("{RIGHT}") 
Send("{ENTER}") 
WinWaitActive("Wealth-Lab", "OK")
Send("{ENTER}")
Sleep(2000)
Send("^!x")

I have tried to study the 'Services'-solution and made a service using the 'RunAsSvc' - but since I want to use scheduling I must go for the more advanced solution mentioned under Q4 in the FAQ-link above. Here I would be able to create the service by running a scheduled AutoIt-script (if I have understood it correctly). I'm pretty new to AutoIt and I don't know much about services (will I be able to monitor how the AutoIt script executions progress if I logon or will it run completely in the background, and what it something fails, where do I look up this information?), so I would be very thankful, if someone could hint me on how to put the code together to reach my goal. The easy solution for my would of cause be to let my computer run all night and switch off the logon screen. Alternatively I could go for a macro key recorder (suggestions are welcome), but I really like the AutoIt scripting language (even if it can seemingly become quite complex when trying to run scripts as services).

Link to comment
Share on other sites

The code you've provided will not run behind the windows login screen, it will never see any of the windows that you're waiting for to be active as actually being active.

Further, your script will break as soon as your computer takes an extra second or two to process something and skips a step because AutoIt went ahead and did what it was supposed to but the window it's working in didn't exist/wasn't ready for it yet. You need to find some other way of getting the data from your programs, I don't know if there are specific controls (buttons, text fields, etc.) that you can interact with to get where you're going and then get what you need (ControlClick/ControlGetText) but that'd probably be the best way to go.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...