Enikeyschik on a leash: Review of programs for automating routine operations. Enikeyschik on a leash: Overview of programs for automating routine operations Autoit syntax



1. What is AutoIt3 for?

AutoIt is designed for general automation tasks. To achieve this goal, a standardized BASIC-like programming language was created. This means that if you are already familiar with any scripting programming languages, then you are likely to master AutoIt v3 with ease.

2. Is it difficult to master AutoIt?

It is very easy to master AutoIt3, see the example of calling commands

9. Why, when I try to display the value of a variable using the "Variable value: $ variable" construct, I don't get the expected result?

If you have a variable named $ msg and you want to output it to MsgBox, then the following will NOT work:

12. How to terminate script execution when pressing a hotkey?

If you want to terminate the script when a specific key combination is pressed, use the HotKeySet function, which runs a user-defined function when the specified key combination is pressed. This custom function must contain the Exit keyword.

Below is the code that terminates the script when you press CTRL + ALT + x

13. How do I use my own icon for the compiled script?

You need to run the script compiler (not just select “Compile / Compile” when you right-click on the script file). This help page describes how the compiler works in more detail. Also use AutoIt3Wrapper to specify the icon in the script itself using directives.

14. How can I prevent the second copy of my script from running?

Use the _Singleton () function. See the User Defined Functions (UDF) Help topic for more information on how this function works and how to use it.

15. What are the technical limitations of AutoIt3?

Below you will find the current technical restrictions imposed on AutoIt. Keep in mind that some limits are purely theoretical and you are more likely to hit performance or memory limits before the limit kicks in. Also see the section " "

Value Description
2147483647 The maximum length of the string variable. Considering the limitation of 2 GB per process and the characters in memory in Unicode, this significantly reduces the indicated value
not limited Maximum GUI windows
5100 Maximum nesting level for recursive function calls
not limited Maximum number of custom functions
not limited Maximum number of variables used in the script

Number range ate floating point with 15 decimal places

Integer range: 64-bit signed integer type

0x7FFFFFFF

Hexadecimal range: 32-bit signed integer type
64 Maximum number of dimensions in an array
16 million The total number of elements in the array

16. Why is some image missing in the examples in the help file?

It should have been the “Open” button, which opens the help examples in the editor window. This kind of error occurs when the hhctrl.ocx library is not registered correctly on the system or the file is corrupted.
Try to register by running the command "regsvr32 hhctrl.ocx" (dialog "Run" by Win + R) or check the file is working properly.


Influenced by: Influenced: Website:

AutoIt is a free language for automating tasks in Microsoft Windows. In earlier versions, the program was primarily used to create automation scripts (sometimes called macros) for Microsoft Windows programs. Such scripts are useful for performing frequently repetitive tasks, such as installing identical sets of programs on a large number of computers. Later versions of AutoIt have improved language design and increased overall functionality, bringing AutoIt closer to general-purpose languages.

With the release of AutoIt 3, the syntax of the language was restructured and approached the BASIC family. The script can be compiled into an executable file independent of the interpreter installed in the system.

AutoIt uses simulation of keystrokes, mouse movements and manipulation of windows, controls. This allows you to automate Windows user tasks in a way that is impossible or difficult in other programming languages. In addition, this language is compact, self-contained and works on all versions of Windows "out of the box", without external .dll libraries and registry entries, which allows it to be used safely on servers.

Language features include:

  • Compatible with Windows 2000 / XP / 2003 / Vista / 2008 / Windows 7/2008 R2
  • Version for 64-bit systems.
  • User Account Control (UAC) support in Windows Vista.
  • Unicode support since version 3.2.4.0.
  • Launch console applications and access standard I / O streams.
  • Run programs as another user (RunAs functions).
  • Compiling the script into an EXE file using Aut2Exe.
  • Includes files in the compiled file that can be extracted at startup.
  • Compressing and protecting the executable file from decompilation using the UPX packer
  • Creation of graphical GUI interfaces, information messages, information input forms.
  • Calling functions from 32-bit dynamic libraries and Windows API functions.
  • Working with the Windows registry, clipboard, files (read, change, copy, delete).
  • Working with COM objects (component object modeling).
  • Interception and emulation of keystrokes and mouse clicks.
  • Working with windows (especially standard ones): move, hide, show, resize, activate, close, etc. Windows can be accessed by their title, display text, size, location, class, internal Win32 API handles, which are defined using the supplied AU3Info utility.
  • Obtaining information and interacting with controls (especially standard ones): edit field, radio button, list, buttons, status bar, etc., incl. inactive.
  • Internet: reading HTML code of pages and downloading files, working with FTP, sending E-mail messages, working with MySQL and SQLite databases.
  • Work with TCP and UDP protocols.
  • Automation of work in browsers: Internet Explorer, Opera, FireFox.
  • Common elements of a high-level language, such as working with loops.
  • A huge number of functions for working with text (strings), incl. with Perl-style regular expressions (using the PCRE library).
  • Working with sound.
  • Performing complex mathematical calculations.
  • Simple syntax similar to BASIC.
  • AutoItX is a combined COM and DLL version that allows using AutoIt capabilities in programs written in other languages.

Like other scripting languages, AutoIt is a third generation language that uses the classic model and variant type variables to store various data types, including arrays. AutoIt lacks (or has limited support) namespaces, object-oriented programming, abstract data types, classes, advanced graphics functions. However, in addition to the capabilities built into the AutoIt core, you can use a large library of ready-made functions.

A popular use of AutoIt is developing utilities for Microsoft Windows. Common tasks such as website monitoring, network monitoring, disk defragmentation, and backups can be automated and combined into a customized utility.

Often AutoIt is used to create bots for online games. Bots allow you to automate some actions in games, as a result, the user can quickly achieve the desired result. This use of Autoit is discouraged by the community as it creates a bad reputation for the program, however several such scripts can be found on the official forum. The use of bots is viewed by most AutoIt users as cheating and you shouldn't expect much help from the community in building them. Many members of the community do not consider such requests at all.

To simplify the development of graphical interfaces, there is a visual form editor Koda FormDesigner, which has an interface similar to the Delphi IDE. Supports visual creation and modification of all dialog elements available in AutoIt (buttons, input fields, menus, etc.)

The source code for AutoIt 3.1.0 in C ++ is available for download in the AutoIt archive; the code of further versions is closed. The AutoIt source code was used to create the AutoHotkey language. It was developed by a small team but with active support from users from all over the world. Third-party support includes, but is not limited to, help files, sample programs, support forums, mailing lists, utilities.

The current version of the language is available for download on the official website of the project, as well as previous releases.

Example

Hello World program:

; Displays a standard window with the name "Example", with the caption "Hello, world!" and the "OK" button. MsgBox (0, "Example", "Hello world!")

Creating a dialog box:

; Displays a dialog box with "OK" and "Cancel" buttons. If you click "OK" - exit from the program. ; Tabs in the example are for readability. $ WantExit \u003d MsgBox (1, "Question", "Do you want to exit the program?") If $ WantExit \u003d\u003d 1 Then Exit EndIf

Automatic launch of the Notepad program:

; Launches Notepad, writes text in its window, closes the program, canceling the save. Run ("notepad.exe") WinWaitActive ("Untitled - Notepad") Send ("Here is some text.") WinClose ("Untitled - Notepad") WinWaitActive ("Notepad") Send ("! N")

AutoIt Community

The official English-language forum is located at http://www.autoitscript.com/forum/. There, users can share their scripts and functions, receive technical support, report bugs, submit ideas and suggestions, and communicate with developers.

see also

Notes

Links

Categories:

  • Introduced in 1999
  • Alphabetical programming languages
  • Software development tools
  • Scripting languages

Wikimedia Foundation. 2010.

See what "AutoIt" \u200b\u200bis in other dictionaries:

    Autoit - Développeur Jonathan Bennett et le groupe AutoIt Dernière version… Wikipédia en Français

ALEXEY BARABANOV

MS Windows automation, or AutoIt as an enikeys' dream

Part 1

If the copier does not work, call the system administrator.

It's an electronic device, isn't it?

Since the advent of computers, humanity has been divided into users and "computer scientists". They stood on opposite sides of the electronic computing machine, sometimes confused about the exact belonging to their class or group. But gradually everything and everything fell into place. The number of users increased, and the number of "computer scientists" was only specified. While computers were few and far between, and they were large engineering structures, serviced by entire teams of "computer scientists", which included a fair amount of mechanics and electricians, the number of users per computer was tried to be as large as possible. Few people were interested in the overall ratio of users to “computer scientists”, since computers were the main resource. But with the advent of personal computers, when the proportion of their number to the number of users has irrevocably passed into the category of integers, it became very expensive to have a team to maintain each computer. It was from that moment, since the creation of personal computers, that both hardware and software developers began to think about reducing the cost of maintaining their products. It was then that abstract "computer scientists" began to turn into system administrators, specializing in the maintenance of computer systems. At the same time, special software products began to appear, designed specifically for system administrators or primarily focused on solving maintenance problems.

For example, IBM 360 DOS users had to somehow know and be able to use the JCL job control language, and if they worked in console mode, then the system control language. But the same IBM PS / 2 users working in the OS / 2 environment could no longer know anything about the system settings and be content with only what the graphical interface provides them.

Thus, the issue of distinguishing users from system administrators was reduced to the difference in the interfaces they used. The user of a computer built into a mobile phone controls the device using a graphical interface and buttons on the body of the device, and a technician servicing the same phone uses console commands or a graphical interface of a special computer program, to which the said phone is connected via a technological JTAG connector. In other words, the interface must match the tasks being solved. But for personal computers, the interface had a truly fateful meaning. Indeed, the most important difference between them and computers used collectively was the exclusive provision of all resources to one user. This could not but affect the way of solving the interface problem. Many of the first personal computers were sold as TV set-top boxes, such as the Sinclair. That is, without a TV it was not a computer yet, but after connecting it, the computer could already be used. This showed the importance of the interface.

The commercial success of PCs depended to a very large extent on how the interface issue was resolved and how easily untrained consumers could use this interface. If the first PCs had the same text-based interface as mainframes (for information, many called JCL "bird's language" for being overly entangled), then, most likely, just having appeared, these devices would have sunk into oblivion. But this did not happen precisely because of the accessible and attractive graphical interface. At first, the main thing was in the screen itself, that is, in the television tube. Probably, people were attracted by the fact that with the help of it it was possible to view not only news and movies. But then Xerox successfully experimented with teaching intelligent bipedal mammals how to use a one-button mouse. This was truly a revolutionary event. And although the "mouse" since that time has managed to increase the number of buttons, but the proposed method of interacting with a PC by pressing the mouse buttons, or "clicks", has become a part of the everyday life of computer users. And in the same way, he unambiguously forced the system administrators to take a negative stance towards this process - "mouse" clicking.

Interfaces

If the sysadmin tells you on the phone,

what buttons to press, read the newspaper.

In fact, I don't want you to do anything.

Why did the "mice" not suit the sysadmins? It was not so much about the “mouse” manipulators, but about the peculiarities of the graphical interface used then. Since the number of computers serviced by one employee became the main indicator of the level of system administration, the means of ensuring the automation of system operations, installation of the OS, its configuration and management, became crucial. And the solution to this issue was closely related to the provision of all the same works via remote access channels. Naturally, for platforms with a text interface, both the first and the second were easy to solve. There were simple scripting languages \u200b\u200bthat made it possible to very quickly program any OS control operation, and the means of providing remote access in text mode were provided at a rather weak technological level of communication. For example, this is how the administration issues were solved in the OS of the UNIX family. But in graphical operating systems, things were not so simple. First, the graphical interface is semantically completely determined by the application program. That is, the reaction to the activation of the "OK" button in the graphical menu depends on the phase of the dialogue and on the purpose of the program serving it. Secondly, providing remote work in a graphical environment required much more bandwidth from communication channels than working in a text interface. All this led to the fact that the automation of graphical settings practically did not develop. Well, perhaps by the OS developer himself, in this case Microsoft, by increasing the complexity of the nested menus. And for system administrators, working in the Microsoft Windows environment turned into an endless training of the wrist muscles, since their capabilities practically did not differ from those that were provided to ordinary users, only the titles and contents of the drop-down windows changed. This played a positive role - a manipulator of the "mouse" type has recently turned from a primitive "wheelchair" with impellers and a rubberized ball into a high-tech device based on an optical (laser) scanner and equipped with a radio channel for communication with a computer. But it is clear that even if the manipulator "mouse" is transformed into an implant with a computer interface, it will still not allow one system administrator to simultaneously serve more computers, as required by the modern IT industry, subject to the rigid TCO framework: http: // www .telecominfo.ru /? t \u003d 2012, table 2. And the growth of the indicator of the number of simultaneously served user computers (Full Time Equivalent - FTE) was restrained by the underdevelopment of the means of automating system work in the OS, built on the basis of graphical interfaces.

This is not to say that everything was limited only by technological problems. The fact is that on the MS Windows platform, which for a long time had no alternative for personal computers, mainly proprietary software products are used. And the solution to the problem of their mass installation runs counter to the requirements to comply with the mandatory registration (legalization, activation) procedure for each copy of the program. Usually, the copy registration procedure is furnished with special protective protocol and not always technical actions, for example, you need to agree with the license, enter the serial number from the box or CD, insert the key disk into the drive tray, activate via the Internet, and much more that comes to mind a developer concerned about making a profit. Even the MS Windows operating system itself in its boxed embodiment is not intended for creating automated installation systems based on it. What is the point of automatic duplication of one copy if, according to a marketing plan, all sold copies of this system require an original registration procedure for each of them. Of course, loopholes and other reservations were left. Well, the “founding fathers” of this software “pyramid” could not simply reduce the entire institution of system administrators to the position of “enikeys”. Therefore, there were so-called "corporate" versions, which allowed for serial installation, like copying the same installation procedure to multiple computers. True, in retaliation, other restrictions were introduced there, for example, on the installation of updates. But even such a surrogate freedom to automate the routine operations of installing their own products could not be allowed by every software company. Therefore, another problem of automating work in the GUI environment is that many software products are not intended for automatic installation and configuration due to design, since they required “human” actions during the installation process.

Animation instead of automation

If you see the message "Are you sure?"

click "Yes" as soon as possible!

Damn it if you weren't sure

you wouldn't do that, would you?

And now all these problems were solved. A tool for automating operations in a graphical windowed environment appeared, which imitated the work of a human operator, called AutoIt and was originally intended to automate the operations of installing programs. You can now use version 2.64 by downloading it from http://www.hiddensoft.com/AutoIt, and version 3.1.0 available at: http://www.autoitscript.com/autoit3/index.php. These programs are distributed under open licenses. Version 2.64, written by Jonathan Bennet, can be used in non-commercial projects without restrictions, and in commercial projects, you must provide a link to the developer's site with the product. Version 3.1.0, the authorship of which belongs to the aforementioned Jonathan Bennett together with the AutoIt Team, is already under the GNU GPL, which testifies to the maturity of the approach and the impossibility of further removing this program from the free circulation by transferring it under some kind of closed license. In addition to the attached Help file in English, both versions also have a Russian version of the documentation in chm format prepared by Valery Ivanov.

If we consider this program separately from the context of the intended application, then this is just a means of intercepting the analysis of the state of the window interface and emulating the necessary messages, allegedly on behalf of the operator. It almost looks like a demo animation. But from the point of view of a language machine, for example, Unix bash, which interprets some script, all actions look exactly the same multiplicative. Only this is not noticeable to anyone if it happens not on the screen, but in a text console. Moreover, text interpreters have the ability to hide and redirect processed character streams. But you can also name a complete textual analogy from the * nix world to the program discussed here. This is the well-known expect facility. It allows you to replace communication with text terminals for some application program and thereby automate the operator's work by emulating the process of his work. This is usually used to automate work with interactive environments, such as ftp. Notably, both expect and AutoIt include a facility to facilitate scripting by writing intercepted real interface data. Of course, in AutoIt this is still a very immature manual tool that shows the characteristics of the selected GUI element in a modal window.

In terms of technology, AutoIt only uses the capabilities of the GUI API. The same result can be achieved with Visual Basic or even C ++. But the difference is that using AutoIt avoids programming in "heavy" languages. For the sysadmin is not a programmer, and he does not need to write programs, but only to solve standard automation problems that arise in the course of his work.

So how does it work. Such a tool should be able to enter all the necessary data into the environment it controls, analyze the response, and, to the extent of standard language capabilities, organize the interactive execution of the described process. All! If the interface is textual, which is true in relation to expect, then such a system must enter string sequences, accept and parse response strings and, depending on the result and due to the capabilities of its syntax, organize some algorithmic process. If the interface is graphical, then GUI-specificity is added to the above. Added to the input data are control over the behavior of windows (detection, activation, minimization, closing, etc.), bookmarks and other elements of the window interface, moving the mouse and pressing buttons on it. In the same way, events for creation, activation and other operations with windows are added to the received data. Well, the rest is entirely determined by the design of the embedded language. Version 2. * uses a language with syntax similar to assembly, with comma delimited and primitive control statements based on conditional jumps. In version 3, this is almost a full-fledged programming language with the usual control structures, including functions, and as a result goto has been removed from use in this release. Both versions allow both interpreting statements written in a separate script file and creating an executable version based on runtime components. But version 3. * is "heavier" one and a half times. Therefore, executable files based on the 2nd version have a size of 40 KB, and versions 3. * - from 116 KB. Probably due to more built-in functions. In addition to the already mentioned version 3. * has built-in timeouts in wait statements, which allows solving the problem of "freezing" of unstable applications, but in the practice of automating standard actions, you can successfully do without this. In other words, solutions based on version 2. * have not lost their relevance for 90% of tasks solved with AutoIt, but release 3. * allows you to create full-fledged applications, if necessary. There are even examples of game programs on the Internet resources dedicated to AutoIt.

Installing the software

If you are taking an evening computer course,

be sure to check your knowledge on your

and all neighboring computers.

We love to work until 2:30 am fixing this.

I think the theory is enough. Next, we will consider various examples of the real use of the proposed technology. It is not intended to write large and sophisticated programs here. The main thing is that these are efficient and practical scripts and programs. Some of them will be analyzed in the text, others are simply indicated in the links and are intended for independent study. Many of them will be used in the final comprehensive example of creating a disc for unattended MS Windows installation. Starting from the simplest, the proposed programs will gradually become more complex, which does not prevent, after reading the entire article, to return to the beginning and rework the considered programs using the entire arsenal of AutoIt.

As a first practical example, consider automating the installation of AutoIt itself. Since we have two workable releases at once, the 2nd and 3rd, we will solve the problem of automatic installation of AutoIt version 3 using the script for the 2nd. To do this, install AutoIt version 2 into the system and create a setup_autoit3.aut file using the Notepad text editor. The "aut" extension is standard for AutoIt2 scripts. Let's write the following sequence of operators:

SetTitleMatchMode, 2

DetectHiddenText, on

// remove all windows from the screen

WinMinimizeAll

// wait a second

Sleep, 1000

Run, autoit-v3-setup.exe

// finish

Exit

This very short program will be the basis of the developed script. All operators are annotated and are quite obvious in their content. But before launching it for execution, load "AutoIt Reveal Mode" - a special tool for viewing information hidden in the structures associated with windows in MS Windows. Then we will run the script and wait for completion. After the completion message appears, close it by clicking on the "OK" button and expand all the windows again. It should turn out as shown in the picture.

Note here that the AutiIt v2.64 window contains the entire list of text lines from the active window, starting from its title. It is on these lines that the installer will be further "caught" in our script, and since the Next button is already highlighted as active, as soon as the script waits for the window with the name "AutoIt v3.1.0. Setup ”, you can send this window Enter, which will lead to pressing the active button, that is, to go to the next installer screen. Here is the text for the next more complex development phase:

// set the hidden text detection mode in windows

SetTitleMatchMode, 2

DetectHiddenText, on

// remove all windows from the screen

WinMinimizeAll

// wait a second

Sleep, 1000

// run the installation from the same directory

Run, autoit-v3-setup.exe

Send, (ENTER)

// display a window with a message

MsgBox, 0, AutoIt, Setup done

// finish

Exit

To check, we will cancel the installation and run the script on a new one.

After stopping, we will finish our script again, expand all windows and analyze the result shown in the figure.

Here, similarly to the first launch, follow the sections marked in red. The task is to "catch" a new window and activate the desired action. But the window has the same name as the previous one! Then we look in the interceptor window, what other string values \u200b\u200bare available to us. We find the line "License Agreement". This line perfectly reflects the specific meaning of the resulting window. And since here again the desired action is immediately the default, then after finding this window, you need to send Enter to it again. We change the text as follows:

// set the hidden text detection mode in windows

SetTitleMatchMode, 2

DetectHiddenText, on

// remove all windows from the screen

WinMinimizeAll

// wait a second

Sleep, 1000

// run the installation from the same directory

Run, autoit-v3-setup.exe

// wait for the desired window and click Next

WinWaitActive, AutoIt v3.1.0 Setup

Send, (ENTER)

Send, (ENTER)

// display a window with a message

MsgBox, 0, AutoIt, Setup done

// finish

Exit

Pay attention to how the syntax of the WinWaitActive operator has changed, since now you need to determine the window not by its name, but by the text inside, then the detected string is written in the third field. Stop the installation again and do the same operations as in the previous launch. After stopping, you should get a result similar to the one shown in the figure.

Everything here is similar to the second cycle of development of an automation script. We find the line for detecting the window, we determine which buttons should be pressed. We write everything into the script. The development of the fourth cycle proceeds in the same way. Actually, you can run the entire installation in a continuous loop and just memorize the lines that define each of the installer's windows, and write down the keyboard codes that are entered in this process. Programming with AutoIt is extremely easy. The result is the following program:

// set the hidden text detection mode in windows

SetTitleMatchMode, 2

DetectHiddenText, on

// remove all windows from the screen

WinMinimizeAll

// wait a second

Sleep, 1000

// run the installation from the same directory

Run, autoit-v3-setup.exe

// wait for the desired window and click Next

WinWaitActive, AutoIt v3.1.0 Setup

Send, (ENTER)

// similarly wait for the license agreement

WinWaitActive, License Agreement

Send, (ENTER)

WinWaitActive, Choose Install Location

Send, (ENTER)

// complete installation

WinWaitActive, Click Finish to close

Send, (ENTER)

// display a window with a message

MsgBox, 0, AutoIt, Setup done

// finish

Exit

This program installs AutoIt v3 automatically. It can be converted to executable rather than interpretable code. But I propose to run it completely and then proceed to work in AutoIt v3, which will be installed at this moment. First of all, let's use the utility for translating tests from version 2 to version 3 “v2 to v3 Converter”. This approach allows you to immediately get a syntactically correct program. Here's the result:

// V2.64 to V3.0.100 (Version 1.0.6)

// Converted with AutoItV2toV3

// (C) Copyright 2004 J-Paul Mesnage.

// set the hidden text detection mode in windows

AutoItSetOption ("WinTitleMatchMode", 2)

AutoItSetOption ("WinDetectHiddenText", 1)

// remove all windows from the screen

WinMinimizeAll ()

// wait a second

Sleep (1000)

// run the installation from the same directory

Run ("autoit-v3-setup.exe")

// wait for the desired window and click Next

WinWaitActive ("AutoIt v3.1.0 Setup")

Send ("(ENTER)")

// similarly wait for the license agreement

WinWaitActive ("", "License Agreement")

Send ("(ENTER)")

// window with a choice of installation location

WinWaitActive ("", "Choose Install Location")

Send ("(ENTER)")

// complete installation

WinWaitActive ("", "Click Finish to close")

Send ("(ENTER)")

// display a window with a message

$ __ msgbox \u003d MsgBox (0, "AutoIt", "Setup done")

// finish

Exit

As you can see from the text, the new syntax does not carry any significant changes. After conversion, the script was placed in the setup_autoit3.au3 file, the extension of which has the standard value for version 3. But the program does everything the same. If you convert it to executable code using the compiler available in version 3, then after removing AutiIt v3 from the system, you can reinstall it using the new program. This will be the health check.

But just as not all the work of a system administrator is limited to installing application software, so AutoIt's capabilities are not limited to servicing programs like setup.exe. But more on that in the next part.

Windows OC gained popularity primarily due to its user-friendly and intuitive interface. But if an ordinary user only benefited from this, then for the administrator, button control has many inconveniences. Of course, some tasks can be solved using console commands and scripts, but not all. And here special automation tools come to the rescue.

AutoIt

One of the most popular automation tools among admins is AutoIt (autoitscript.com/autoit3), which simulates keystrokes, mouse clicks and other similar actions that a user usually performs when working in GUI applications.

Using AutoIt, all of these movements can be programmed using BASIC-like language. The program can manage processes, access Windows API and DLL, registry, clipboard, files (read, change, delete), create GUI, messages, data entry forms, work with databases (MySQL and SQLite), read HTML code, download files, send e-mail and much more. In general, it all depends solely on the desire to tinker with the settings. It is gratifying that AutoIt does not require programming skills from the admin. In scripts, you can easily access window controls with just a couple of lines of code. Keep in mind, however, that AutoIt works seamlessly with standard Windows windows. If the authors took care of the uniqueness of the interface, you will have to sweat a little with the AutoIt setting to find the necessary parameters.

Supports Windows from 95 to 2k8, including works in 64-bit versions of the system, "friends" with whist's UAC. Conveniently, the scripts can be compiled into an exe and then executed on another machine. No additional applications and libraries are required.

AutoIt is distributed under a freeware license that allows its use without restrictions, including for commercial purposes. Installation is standard, there are no additional requirements. The current version is 3, which is not syntactically compatible with the previous, second version. The program comes with the SciTE4AutoIt3 script editor, the AU3Check.exe syntax checking utility, ready-made examples, the Aut2Exe compiler (and the reverse Exe2Aut) and help. During installation, the * .au3 extension will be associated with the AutoIt interpreter.

The scripting language used by AutoIt is one of its strengths. It is both powerful and simple. For example, to run a program, you just need to write:

That's it, no more action. AutoIt is a great way to automate the installation process for applications that don't support answer files. To catch windows, the WinWaitActive function is usually used to enter parameters, which interrupts the script execution until the window is activated. The window title and optional additional text should be specified as function parameters. The latter allows you to distinguish between different windows of one program from each other. For example, the windows of the installer of AutoIt itself contain the same title - AutoIt v3.3.6.1.5, that is, if you use:

WinWaitActive ("AutoIt v3.3.6.1.5")

This design will follow all the steps of the installer. Therefore, it is better to clarify by entering additional text that is displayed in the window, for example:

WinWaitActive ("AutoIt v3.3.6.1.5", "License Agreement")

So we will definitely refer to the license agreement window. It remains only to send him a confirmation: Send ("! Y")

As you can see, everything is simple. Along with the programs, the AutoIt Window Info Tool (AU3Info.exe) utility is also installed, which will help you to get all the information on the window title, text (displayed and hidden), status bar, location, color and so on. We just start and move the cross over the window, after which we read all the values \u200b\u200bin the Window Info Tool. With its help, it is much easier to collect the necessary information on the experimental program window. Help in AutoIt is very detailed, it has all the subtleties of using the language. In the documentation on the project website, you will find a link to the translated version of the help. Plus, numerous specialized forums usually have a separate branch. There should not be any problems in learning AutoIt, in one evening you can learn how to write simple scripts, complex solutions will naturally require a lot of time.

Xstarter

Another popular program for automating routine tasks of a system administrator. The developer is our compatriot, Aleksey Gilev (xstarter.com/rus), respectively, xStarter has a localized interface, and most importantly, the program is distributed free of charge for Russian-speaking users.

Once installed, xStarter can be started manually, automatically when a user logs in, or started as a Windows service. The latter option allows you to run the task at exactly the specified time, regardless of user registration in the system and other factors, as long as the computer is turned on. It offers periodic execution of tasks, a compound schedule, setting skips and actions for missed tasks, triggering by event. In general, there are more than enough options. Using xStarter, you can expand the list of hotkeys or override their values \u200b\u200bglobally or locally. For example, you can easily make the task run when you press the key combination , but only if Firefox is running.

The launched program is placed in the tray, by clicking on the icon, we call the task editor. In the Sections / Tasks window, we will find two dozen examples, as they say, for all cases. Enabled tasks are marked with a green icon.

We select the one that is closest in meaning (or create a new task), copy it using the context menu and edit it to fit our needs. Each task is configurable in four tabs. So, in the "Schedule and Information" tab, we indicate the name of the task, the time or event at which it will be launched, a key combination and an optionally active program window, when the task appears, the task should be completed. The "Actions" tab contains the actual macros. Press "New action" - a window for setting parameters appears. On the left side, we find the presets, divided into several groups, then clarify the parameters on the right side. The rest of the task tabs allow you to configure variables, set priority, run in a separate process, logging. Everything is very simple and straightforward.

To activate blocked functions, you must additionally install the xStartHooks module. In this case, xStarter will behave like a typical Trojan or malicious software - it will start to intercept system calls, "press" keys and send messages, which may not like antivirus and firewalls. But with some antiviruses (for example, NOD32) this can be easily solved, just add xStarter to the exceptions.

For convenience, macros can be compiled into an exe file, and all the necessary libraries can be automatically added here under certain settings. Then we distribute such files to other systems and execute.

It remains to add that all Windows operating systems from NT4 to 2k8 / 7 are supported.

On the project forum you can find examples of some popular tasks, including downloading files, sending SMS and e-mail, backup and data synchronization.
Also, a special version of Starter Job Scheduler for Firebird / Interbase is available on the site, it is designed to execute SQL scripts, backup and restore data in these DBMS. Another unique feature is remote control of the launch of tasks, as well as viewing the log using the special xStarter Web Pilot application.

Automate

Probably the most famous commercial task automation software is AutoMate, developed by Network Automation, Inc (networkautomation.com). Its main feature is the creation of tasks using a convenient GUI, without the need to write code. The entire process is simplified through the use of wizards and a dedicated Task Builder. The program contains a large number of ready-made action templates and reactions to them, which further simplifies the process of creating a chain of actions. The current version of AutoMate 7 at the time of this writing supports more than 230 predefined actions that allow you to schedule tasks, work with files and databases, transfer data via FTP / SFTP, encrypt using PGP, monitor systems, access WMI and much more.

AutoMate is available in four editions, all geared towards specific uses: AutoMate Professional and Premium, AutoMateBPAServer 7 Standard and Enterprise. The simplest one - AutoMate Professional - provides a convenient interface for creating tasks on the local system. The most advanced - Enterprise - provides the ability to easily manage accounts and roles, work in AD, provides centralized management of multiple machines, SNMP support, telnet and terminal emulator.
All Win OSs from XP SP2 to 2k8 / 7 are supported. Installation requires Microsoft .NET Framework version 3.0.

The actual management is carried out using two consoles - Task Builder and Task Administrator. Task Builder creates tasks. This process is quite simple: in the panel on the left of the 29 available groups, select the desired action and drag it to the middle field. A wizard appears to help you refine your settings. For example, let's create an action to get data on a hard disk partition. Go to the System -\u003e Get Volume Information menu, a wizard of the same name appears, consisting of four tabs.

We need to consistently go through and select the parameters in each of them. In General, specify the disk partition and the parameters that we want to receive: type, label, file system, location. Alternatively, you can immediately specify the selection of all volumes (All volumes) and then, by clicking the icon next to the field, set the check condition. The program provides a number of built-in variables, functions and triggers that you can use in this field. You can also create your own condition. In other tabs, a description of the task and an action on errors are set.
After creating a task, it appears in the list in the middle, where it can be edited, moved, disabled, and so on. Further, in the same way, select and add other Actions. For debugging, you can add breakpoints to the job (Breakpoint, ).

To manage all tasks, both on local and remote systems, the Task Administrator is designed. Having selected any task in it, we can view its properties, activate or create a new task. Triggers, priority, protection, account under which it will be executed are prescribed in the properties of the task. There are many settings, they are very diverse. Tasks are saved in files with the * .aml extension.

AutoHotkey

AutoHotkey (autohotkey.com) is a fork of AutoIt v2. Its author, Chris Mallett, suggested adding support for hotkeys to AutoIt, but the idea did not find a response, and as a result, the Initial release was released in November 2003. Unlike its parent product, AutoHotkey is available under the GNU GPL license.

The language syntax is based on AutoIt v2, some ideas are taken from v3. With its help, you can easily automate repetitive tasks: starting a program, sending mail, editing the registry. Supported work with files, simulation of mouse clicks, there is the possibility of creating a GUI. The program can monitor system events and take actions when they occur.

But the trick of AutoHotkey is the hotkey management. For example, to start the calculator with the combination , we write just one line:

The hash mark "#" corresponds to the key ... The documentation is quite detailed (the translation is available at www.script-coding.info/AutoHotkeyTranslation.html), it reflects all the features of the language. In addition to the interpreter itself, the project offers a utility for creating a GUI - SmartGUI Creator and SciTE4AutoHotkey editor with highlighting and code completion.

Scripts (extension * .ahk) can be compiled into an exe file and executed on any computer.

Install Firefox automatically with AutoIt

AutoItSetOption ("WinTitleMatchMode", 2)
AutoItSetOption ("WinDetectHiddenText", 1)
WinMinimizeAll ()
Sleep (1000)
Run ("FirefoxSetup3.6.6.exe")
WinWait ("Install Mozilla Firefox")
Send ("(ENTER)")
WinWait ("Mozilla Firefox Installation", "Installation Type")
Send ("(ENTER)")
WinWait ("Install Mozilla Firefox", "Summary")
Send ("(ENTER)")
WinWait ("Install Mozilla Firefox", "Shutdown
installation wizard ")
Send ("(ENTER)")
Exit

AUTOMATION ANYWHERE

The development of the Californian company Tethys Solutions, LLC () has already earned the recognition of the admins and awarded by various media publications. With Automation Anywhere, you can easily automate any repetitive operation, both simple and complex, without the need for programming.

I must say right away that the product is very serious and has a huge number of possibilities. The program can work with files, send mail, start tasks according to a plan or when a trigger is triggered, use VBS and JavaScript scripts, and much more. The technology, called "SMART Automation Technology", eliminates the need for an administrator to be a programmer as well. Recording can be done in automatic mode, when the computer records all user actions. In the future, such a task, immediately or after editing, can be “scrolled” on other systems, observing how the mouse itself runs across the screen and presses buttons. The program offers two recorders: Object Recorder for desktop applications and Web Recorder for recording a sequence of actions in a web browser.

Moreover, Web Recorder in the latest version of the program supports all the main technologies used in the web: Java, JavaScript, AJAX, Flash, frames. The process is quite simple: we launch Automation Anywhere, select a recorder, and the program starts recording all user actions. To stop, press the combination or click on the "Stop" icon in the floating window at the bottom of the screen. At the end of the process, the program will offer to save the record to a file (extension * .atmn). Editing, as well as manual creation of a task is done using the Task Editor.

The developers have already included in the program several task templates that can be used as examples. Editing a recorded assignment also does not require knowledge of the code. By clicking the Edit button, we will see the entire sequence of actions performed on the screen (mouse movements, keystrokes).

The left editor window shows predefined commands, divided by categories, that can be added to the task. Everything is here: working with files and directories, backup, Excel spreadsheets, connecting to the Internet, sending e-mail, capturing a desktop image, starting / stopping services. Select the desired task and simply drag it to the right window. The window for editing properties opens immediately, in which we fill in the proposed parameters (they are specific for each item). The editor supports additional scripts, working with variables, debugging and much more.

The created task can be exported to an executable file and distributed to other systems.

The task can start by time or when a trigger is triggered, this behavior is configured in the Trigger Manager, here you can choose: starting a window with a specific text, the appearance of a file in the directory, resource load (CPU, memory, free space), start / stop of a process or service, receiving a specific e-mail. The developers have not forgotten about security - Automation Anywhere allows you to protect the script with a password and encrypt.

In general, everything that is needed is in the program, except for localization. Supports Automation Anywhere all Windows versions: from XP to 2k8 / 7.

Conclusion

In fact, there are much more programs for automating routine tasks. Paid versions are distinguished by great convenience and friendly interface, the ability to work in a network environment. Although, depending on the preparation and desire to tinker with the settings, you can get by with free programs like xStarter, AutoIt or AutoHotkey.

Standard Windows Task Scheduler

Microsoft finally realized the need for a normal scheduler, and starting with Vista, the system has an improved Task Scheduler (Administration .. Task Scheduler, or taskschd.msc) - significantly redesigned compared to previous versions. Its interface allows you to connect to another computer for configuration, create (simple and advanced) or import a task. Thus, the main elements of the task are Triggers, Actions, Conditions and Settings. The trigger determines when and upon the occurrence of what event to start the task: by time, when the computer is turned on, when the system logs on, when an event appears in the log. In the latter case, you must specify the log where the event will be tracked, the source and the event code.

The conditions and parameters clarify the essence of the task, and the action determines what actually can be done (start the program, send a message). The possibility of delayed start of a task allows you to delay the start in situations when its immediate launch is unacceptable (for example, high system load). Conditions specify other options for the job, for example, when the computer is idle.

Did you like the article? To share with friends: