Tracking Data File Providers - Adding Windows Script Components

Adding Windows Script Components

After you create your custom script using the Windows Scripting Component method, you can use the Plugins tab of the Options window, accessible from the Tools menu, to add it to ODTK:

  1. Register the script by opening the Command Prompt window, navigate to the folder where the plugin is stored and enter regsvr32 <plugin name>; e.g., if the plugin is named WscVbsCOBTrackingDataPrv.wsc, enter:
    regsvr32 WscVbsCOBTrackingDataPrv.wsc
  2. In the Plugins tab, click the Add... button to add a new line to the Tracking Data Files Providers list.
  3. Double-click the first field in the new line, Extensions, and list the file extension(s) to which the new script will apply. If more than one extension is listed, separate them with semicolons (;).
  4. Double-click the second field, Description, and add a brief description of the measurement file type(s).
  5. Double click the fourth field, PluginID, and enter the plugin file name (e.g. WscVbsCOBTrackingDataPrv.wsc) of the plugin script.
    Note: The progid must be the same as the file name for the plugin to work properly.
  6. If you wish the new file type to be used as a default, select it in the list and check the Set as Default box.

Regsvr32.exe requires administrator rights in order to register a plugin. Once registered, it's available to all users on that machine (provided that the actual file location on the disk does not change). It's sometimes difficult to find a system administrator to register the plugin though. In this case we have provided a VBScript utility "register_wsc_hkcu.vbs" located in your install under <INSTALL DIR>\CodeSamples\Extend (where <INSTALL DIR> is typically C:\Program Files\AGI\ODTK 6 (32-bit Windows) or C:\Program Files (x86)\AGI\ODTK 6 (64-bit Windows)). The utility will register a Windows Script Component to the HKEY_CURRENT_USER area of the Windows registry rather than HKEY_LOCAL_MACHINE. To run the utility, open up a command prompt and change directories to the location of the utility. Then enter

cscript register_wsc_hkcu.vbs "Your WSC Name.wsc"

replacing "Your WSC Name.wsc" with the actual full path to the location of your Windows Script Component (WSC) file. The utility will parse your WSC file and make the appropriate entries into the Windows registry. This utility must be run for each user on the machine if they want to use that plugin.

Registration on 64-bit machines

When using regsvr32 on a 64-bit machine, it is important to know whether the COM object is built using a 32 or 64 bit architecture. In most cases, it is using 32 bits. To register a 32 bit built COM object, you must use the 32 bit version of regsvr32. Normally this is found in C:\Windows\SysWOW64. By default, 64 bit machines use the 64 bit version of regsvr32, so you should use

C:\Windows\SysWOW64\regsvr32.exe YOUR_FILENAME

when registering 32 bit COM objects. Currently, Windows Script Components are all 32 bit. COM objects written in PerlScript require an installation of 32-bit Perl software.

ODTK 6.5