Platform SDK: Transaction Server |
[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]
You can use an Automation-compatible language such as Visual Basic Scripting Edition (VBScript) to call the administration objects. MTS provides administrative sample scripts to demonstrate how to use the scriptable objects to automate MTS Explorer procedures.
To run an Automation script outside of an HTML page, you must have the Windows® Scripting Host (WSH) installed on your computer. WSH is a command-line scripting utility that can be installed by the Window NT 4.0 Option Pack for Windows NT computers. WSH enables scripts to be executed directly on the Windows desktop or from the command prompt. You do not need to embed those scripts in an HTML document; instead, scripts can be run directly from the desktop by clicking a script file, or from the command prompt. For more detailed information, see the Windows Scripting Host documentation.
To demonstrate how to use the administration objects in a script, run the sample scripts contained in the \Program Files\Mts\Samples subdirectory. The WSH subdirectory contains the following five sample scripts written in VBScript:
These scripts automate administrative procedures for Sample Bank. For example, the InstDLL.vbs script calls scriptable objects to first delete existing versions of Sample Bank, create a new package named Sample Bank, install components from the Sample Bank Visual Basic, Visual C++, and Visual J++ DLLs into the new package, change transaction attributes, and add a new role. The InstPak.vbs script also uses the scriptable objects to install Sample Bank, while Uninst.vbs automates uninstalling the Sample Bank package from MTS. After running a script, you can see the results of the script in the MTS Explorer after clicking the Refresh toolbar button.
To use the InstDLL.vbs, InstPak.vbs, and Uninst.vbs scripts, you must modify the file path in the script to point to the location of the required files on your computer. For example, the file path in the InstPak.vbs script is the default location for the Sample Bank package, which is:
path="C:\Program Files\Mts\Samples\Packages\"
If you have the Sample Bank package installed in a different location, modify that line in the script to point to the current location of the package.
The InstDllCLI.vbs and InstPakCLI.vbs scripts support command-line parameters so you can include the file location as a parameter when running your script in a console window. At the command prompt, open the directory containing the script you want to use, and type the name of the script and the location of the package or DLLs. For example, to install the Sample Bank package located in the default directory, open the directory containing the samples scripts and use the following command at the command prompt:
InstPakCLI.vbs "C:\Program Files\Mts\Samples\Packages\"
To use the InstDLL.vbs script, you must first do one of the following to register the Java components in the vjacct.dll file:
See Also