Start from Windows Service
Top  Previous  Next

Windows Services is a topic for experts only. If you do not know what a Windows service is, there is a very good chance that you do not need this feature. In the following, we assume that you are familiar with the basic concept of a Windows Service:

You can start iMacros via any application that runs as Windows Service. For example, you can create a Windows Service by calling a VBS script, a VB program or any other normal Windows program using the SrvAny application. The advantage of using a Windows Service is that the application can run even if no user is logged in.

If you use iMacros inside an application that runs as Windows Service (as opposed to running under a regular user account) you need to provide a user name and a password when you use "iimInit":

iimInit (<command line>, <start browser>, <run as user>, <run as password>, <run as domain> [optional] )

If you call iimInit from a Windows Service or from an application that was started by a Windows service, you must provide iMacros with the user name and the password of a user account to run under. Due to a restriction enforced by Windows on services, a service program can either be interactive (have a Console, read keyboard input, etc) or have network access (but not both at the same time). Since iMacros needs both abilities, you need to provide the user name and password of a normal Windows account. You can also provide the password encrypted. iMacros detects automatically if the password is in plain text or encrypted form. To encrypt your password, just copy and paste an encrypted password from a recorded macro.

Example:
iimInit ("", TRUE, "administrator", "password", "")

Running iMacros as a Windows service does not affect the concept of a user session, because iMacros - while started by a service - effectively runs under the user account which you use in iimInit.

Important:
Due to Windows security settings, you must use the "SetRunAs" utility to store the user name and password of the "Run As user" in the registry. The tool can be found in the iMacros Program directory (typically c:\Program Files\iMacros\ ). Experts can also change the settings manually using the "dcomcnfg" utility from Microsoft, but the use of the provided tool is recommended. If you do not make this required setting, iimInit will notify you by returning a "-5" error code.





Page URL http://www.iopus.com/imacros/help/windows_service.htm