Jump to content

Recommended Posts

Posted (edited)

Hello!

I am really frustrated on my vbscript and i am hoping AutoIt will be able to help me. Below is my script that i need to run in a TASK SCHEDULER 24 hrs every 5 mins. The code is working but NOT when i run through the task scheduler. Somehow sendkeys would not work when i am not logged-in anymore.

How can i then use AutoIt to replace my sendkeys and will it work on task scheduler? Please help!!!!

Thanks in advance!

dyan24

set WshShell = CreateObject("WScript.Shell")
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.navigate "http://www.tristategt.org/member/online/graph.cfm"
wscript.sleep 100
objExplorer.Visible=True
    
wshShell.AppActivate "Tri-State Generation and Transmission Association, Inc."
wscript.sleep 3000
WshShell.SendKeys "username"
WshShell.SendKeys "{tab}"
WshShell.SendKeys "password"
WshShell.SendKeys "{enter}"

do while objExplorer.readystate<>4 : wscript.sleep 50 : loop
Edited by dyan24
Posted (edited)

Does anybody on this forum would be willing to give me some reply please!!!

Thanks in advance!!

I don't know if Task Manager tasks even run while the user that created them isn't logged in, but your problem probably has something to do with a limitation like that. I think what you would have to do to make a program that ran even when you were logged out is make a system service, which I don't know how to do.

What is it that you are trying to do exactly?

Edited by cameltoe47
  • Moderators
Posted (edited)

To make sure Task Scheduler is running when you are logged off try this:

  • Open Control Panel, then open Administrative Tools, then open Computer Management.
  • Expand Services and Applications, and then click Services.
  • Right-click the Task Scheduler service, and then click Properties.
  • On the General tab, make sure that the startup type is set to automatic, and that the service status is Started.
  • If the service is not running, click Start.
  • On the Log On tab, make sure that the local system account is selected.
If this doesn't work then I would agree with the last guy. Create a service and use it to run your script. Therefore you would need to make your script pause for 5 minutes then loop. I posted a couple days ago on how to create a service and use it to run a program. Edited by big_daddy

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
  • Recently Browsing   0 members

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