Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm faced with a problem:
Under Windows Server 2003, I need to automate an application (Sage 100) that doesn't have any automation service of its own.

First attempt

I found -and was impressed by- AutoHotKey and have been able to create an appropriate script to automate the application, however, it won't work as a scheduled task as there is no graphical login option in the Scheduler: the task starts, but the AutoHotKey script is unable to detect the windows and send keyboard keys.
The result is that the task just sits there, never performing its actions and never ending.

1) It there a way to force a graphical login, say force a login into a Terminal Service session on the server?

2) Alternatively, is there another way to perform these kinds of automation?

Thanks for your input.

Edit

Thanks so far for the suggestions but I can't find if any of them can actually solve the issue at hand: they all more or less work in the same way that AutoHotKey does and I cannot find any info actually suggesting that these replacements would work better when running under a Scheduled Task when the user is not logged in.

share|improve this question
add comment

4 Answers

You may be interested in autoit3 (Freeware), AutoIT can detect windows and act properly upon them. I use it quite a lot to automate such tasks. You can compile your scripts to executables if needed.


Features of autoit:

  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista's User Account Control (UAC)
share|improve this answer
    
Maybe you can try to compile the autoit3 script and wrap it into a windows service using NTwrapper (duodata.de/ntwrapper) for example. –  Maxwell Jul 2 '09 at 15:37
    
As far as I understand, AutoHotKey is a fork of autoit3. It can generate executables and seems to be as feature complete as autoit3. My script does work very well in an interactive logon but some parts won't work under a RunAs logon: I have to send keystrokes and wait for specific windows to display and this doesn't seem to work outside of a graphical environment. Autoit is interesting as an automation system but I don't see it solving that particular issue that I'm having. Thanks for the suggestion anyway, I'm sure it'll help others. –  Renaud Bompuis Jul 3 '09 at 1:23
add comment

You can use

Phantom

they have free command line tool and a scripting language suitable for automating GUI tasks

share|improve this answer
add comment

I've used MacroExpressfor this sort of thing in the past. I think it's around the 60 USD mark for the basic version.

It would be more of a 'quick and dirty' fix than something scripted but if it works it works!

share|improve this answer
add comment
up vote 0 down vote accepted

Just wrap up this topic.
I asked a more targeted questions: Is it possible for a Scheduled Task to perform a graphical (interactive) logon or use a script to do the same?.

The answer was to use LogonExpert to schedule and automatic interactive logon, then run the scheduled task in the full graphical environment.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.