For information about Globalscape, visit www.globalscape.com. |
The Transfer Engine is a process, not a service. However, you can execute scripts while the system is not logged in if you properly configure Windows DCOM configuration for the Transfer Engine. Carefully read and follow the steps below. A sample script is provided.
To configure the TE under the DCOM configuration applet
Click Start > Run.
In the Run dialog box, type:
DCOMCNFG
Click OK. The Windows Component Services dialog box appears.
In the left pane, expand Component Services, expand Computers, expand My Computer, expand DCOM Config, then click TEConnection Class.
Right-click TEConnection Class, then click Properties. The TEConnection Class Properties dialog box appears.
Click the Identity tab.
Under Which user account do you want to use to run this application, click This user, then provide a valid user name and password. It must be the same user as established under your task scheduler's run as property (if applicable), so that the scheduler service can call the COM object as a user. This will enable the Transfer Engine to run with the user settings, and if necessary, access pre-established SSL certificates (for secure connections).
Click OK to save the changes, and close the Properties dialog box.
Close the Component Services dialog box.
Configuration Notes
If the system is currently logged in when the TE runs, it runs as the user that you specified in the TEConnection Class Properties dialog box. You will not see the TE icon in the system tray when running CuteFTP's main interface. Also, the hard coded user's settings are employed when the TE is run, not those of the currently logged in user. This is not an issue if you are running the TE while the system is not logged in.
You should test your script from the command line while logged in. You can also write to the Event Viewer or a local text file to debug a script when run on system startup if necessary. Below is a sample script that includes event viewer logging of transactions.
Your script should not contain Message Box functions or any other function that requires user input or shows a dialog box. Dialog boxes cannot display these prompts while the system is not logged in. Set your overwrite actions under CuteFTP's Global Options\Transfer\Smart Overwrite to Always Overwrite to avoid any overwrite prompts, or pre-define various rules to cover various overwrite scenarios. (See also Disabling Prompts.)
Const EVENT_SUCCESS = 0
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS,"AT Loaded me"
Set MySite= CreateObject("CuteFTPPro.TEConnection")
MySite.Option ("ThrowError") = False
MySite.Host = "ftp://anonymous:user@user.com@ftp.globalscape.com/pub/cuteftp"
objShell.LogEvent EVENT_SUCCESS,"vars set"
MySite.Connect
objShell.LogEvent EVENT_SUCCESS, "connected"
MySite.Download "index.txt", "c:\temp"
objShell.LogEvent EVENT_SUCCESS, "downloaded"
MySite.Disconnect
MySite.Close