0

I want to run an AutoIt script every day at 1:00 AM on a Windows 2003 Server Standard Edition. Since this is a server, obviously there is rarely someone sitting there logged in at the console, so the procedure needs to account for this.

The AutoIt script in question launches and sends keypresses to a GUI app, so the process needs to include creating some sort of session for the user running the schedule task.

Is there a way to do this?

  • I can't just use scheduled tasks run the AutoIt script when no one is logged in - if I do, it fails to launch at all.
  • I thought that I might be able to create an RDP session and run the scheduled task as that user, inside that session, but I haven't found a way to create an RDP session without launching mstsc.exe -- which is itself a GUI app, and I have the same problem again.

4 Answers4

2

I am not sure if srvany from Microsoft allows to run GUI apps as a service, but AlwaysUp does. You could then use Windows Scheduled Tasks or anything else to make sure your script runs at the desired time.

Sven
  • 97,248
  • 13
  • 177
  • 225
0

you can launch Remote Desktop from the command line. use AutoIt on a machine to RemoteDesktop into your target server.

0

How to use Schtasks.exe to Schedule Tasks in Windows Server 2003

And for AutoIt -- Task Scheduler UDF (User Defined Function).
Has a AutoIt function for the purpose.

You will find more such useful functions at the AutoItScript Wiki UDF page.

Listing of libraries of user defined functions
These libraries have been written to allow easy integratation into your own script and therefore are very valuable resources for any programmer.

nik
  • 7,040
  • 2
  • 24
  • 30
0

You could also use AutoLogon from Microsoft. This will logon to the server after boot. Then a Scheduled task can be set to run after logon.

To ensure that it runs regularly you could have the machine reboot at a set time each day, once again initiating the Autologon and logon scheduled task(s).

473183469
  • 1,350
  • 1
  • 12
  • 23