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.

Can you recommend software that records what you are doing and then plays back the commands as well as allowing you to save that recording and set it up as an automatic task?

The reason I ask is because I'm struggling with automating a manual task because I don't have a way to pass the inputs to it via a normal vbscript or similar. The command is started from a command line but then asks for different inputs (that remain constant on each run).

I'd like a way to record it once, telling it to run "program.exe" then telling it to type "2" and "enter" and then "Bob" and "enter", etc.

Is my best bet AutoIT? I saw it in another question but haven't looked deeply at it in case someone else here had another suggestion that would be better.

Thanks.

P.S. I'm aware that this should be a last resort type thing, but I'm tired of running the same thing daily manually.

share|improve this question
1  
I've found a sledgehammer and knobbling post to work quite well. At the very least, it discourages the developer from writing any more programs that can't be automated. –  womble Jul 19 '12 at 13:41
    
@womble - While I agree with you...it's a 3rd party app and I can't call the company and tell them to rewrite it with my personal input parameters, recompile, and send to me. I take that back, I could, but without enough cash they aren't likely to do it. –  TheCleaner Jul 19 '12 at 13:50
add comment

2 Answers

up vote 6 down vote accepted

I have used AutoIT successfully years ago for such a task. It's certainly the most "prominent" of programs, I think.

share|improve this answer
1  
And you can compile AutoIt scripts into a standalone executable and this executable can be used without the need for AutoIt to be installed on the machine. –  Kalatzis Stefanos Jul 19 '12 at 13:44
add comment

If the window title is consistent you can probably get by with a quick-and-dirty VBScript program using the WScript.Shell SendKeys method. Here's a simple script that illustrates the point:

Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "calc.exe"

Do Until Success = True
    Success = objShell.AppActivate("Calculator")
    Wscript.Sleep 1000
Loop

objShell.SendKeys "94011/3="

This is a very brittle method of automation but extremely inexpensive. It works fairly well if it's running in an environment where no interactive user will be messing with the machine while the script is running.

Microsoft has some reference about how to send "special keys" on their site.

share|improve this answer
    
Evan, thanks, I'll test that route as well. Would I need to set some pauses/sleeps between SendKeys? Meaning if I have one input that then created output, would the next SendKeys wait for that output or immediately try to send something? –  TheCleaner Jul 19 '12 at 18:17
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.