Create and run a script

A script is a user specified command structure that can execute a task, for example an unattended scheduled file transfer.

You create the script in the Script dialog box as a tree structure consisting of:

Global Settings, such as overwrite/delete settings, error handling and log file settings etc.
One or multiple commands, for example a Wait command and a Connect command to connect to a Host.
One or multiple commands, for example Copy, Delete, Synch, or Inventory, which will be executed on the Host after connection.

script_sample

The following example describes how to create a script that copies a file from the Guest to a Host on a specified date and time.

To create this script

1.Click the Script tab to display the tab.
2.On the Edit menu, select New > Script to display the Script dialog box.
3.In the File name field, enter a name for your script, for example "Copy document".

If you do not specify a file type extension, the script will get the file type extension .dws.

4.Click the Open Script button and click Yes to start a new script.

The Global Settings dialog box is displayed.

5.In the Global Settings dialog box, specify settings for the script. You might for example want to review the Overwrite/Delete settings and the Log File settings.

When you are satisfied with the global settings, click OK to close the dialog box.

6.In the Comment field, enter a comment about the script, which will be displayed on the Script tab in the Guest window.
7.Select Global Settings in the tree structure in the upper pane of the dialog box, and click the Add button. Select Wait on the menu.
8.In the Wait dialog box, select Wait until in the Type field.

Specify a date and time for the copying, and click OK to close the dialog box.

The Wait command is added to the script and displayed in the tree structure.

9.Select Wait in the tree structure, and click the Add button. Select Connect on the menu.

In the Connect to Host dialog box, specify how you want to connect to the Host, for example using a communication profile.

Select communication profile and specify IP address and logon credentials for the Host.

The Connect command is added to the script and displayed in the tree structure.

10.Select Connect in the tree structure, and click the Add button. Select Copy on the menu.

The Copy dialog box is displayed.

On the General tab, in the Guest section, specify the file that you want to copy to the Host.

In the Host section, specify the location on the Host that you want to copy the file to, and change any other settings as necessary.

Note

You cannot browse, since the Guest is not yet connected to the Host.

Click OK to close the dialog box.

11.Click Save Script, and click Run to enable the script.
12.Click Close to close the dialog box.

You have now created a script that will copy the Test.txt file to one specific Host on a specific date and time.

If you want to copy the Test.txt file to a number of Hosts, the easiest way to specify this in the script is to first edit the script file (Copy document.dws, located in \\Application Data\Netop\NetOp Remote Control\Guest\script\) in Notepad and then edit it further in the Script dialog box.

hmtoggle_plus1Script file contents

;Copy document to Host computer

;*************************

Script

SET Copy=G_H

SET Delta=Yes

SET CrashRecovery=Yes

SET OverwriteExisting=Yes

SET OverwriteSystem=No

SET OverwriteReadOnly=No

SET OverwriteHidden=No

SET OnComError=NextHost

SET OnError=NextFile

SET AtEnd=None

SET UnloadGuest=No

SET LogAppend=No

SET Log=SCRIPT.LOG

 

WAIT Mode=Until 23:55:00 2009-12-24

 

Connect /Mode=CommProfile /Profile="LAN (TCP)" /Name="10.45.2.33" /LoginCredentials=Yes

COPY  "C:\Documents and Settings\user1\Desktop\Test.txt" "C:\Documents and Settings\"

ConnectEnd

ScriptEnd

1.Copy the Connect command (from Connect /Mode= through ConnectEnd) for as many Hosts as you want to copy the Test.txt file to.
2.Save and close the Copy document.dws file.
3.Open the Copy document.dws file in the Script dialog box again, and for each Connect command, edit the IP address and logon credentials in accordance with the individual Hosts that you want to copy the Test.txt file to.
4.Save the script.

The script you have created automatically copies the Test.txt file to a specified range of Host computers on the specified date and time.

Note

The Guest also contains a couple of slightly more advanced example scripts that you can study to see what you can do with Script. See example1.dws and example2.dws on the Script tab. You can open them in Notepad to see the contents.

Once the script has been executed, you can check the script log file (\\Application Data\Netop\NetOp Remote Control\Guest\) to see if the script was executed successfully.

See also

Script

Global Settings