header pic



FASTTRACK SCRIPTING HOST

 

Components

This topic is covered in greater detail in Chapters 2 & 4 of the FastTrack Users Guide:

The FSH Engine

About the engine

The FSH Engine is the core of FastTrack Scripting Host 2010.  It is the FSH Engine that processes and interprets Scripts, translating commands and functions into the many hundreds of lines of code needed to actually perform the tasks specified.

The engine is installed into the fshbin folder when FastTrack Scripting Host 2010 is installed.  The FSH Engine is an executable file called fsh.exe and it runs just like any other Windows program.

A Script file can be run on a computer simply by specifying it on the command line with the engine.  For example:

ss_install

The engine is fsh.exe and the Script file (in this example) is InstallProgram.fsh, which is the single parameter passed to the engine.

The FSH Engine must be available to any computer that wants to process FSH Scripts.  This can be achieved seamlessly for logon Scripts by simply installing folder fshbin (which contains the engine) into the NetLogon folder on the domain server for a network.

Using the engine to record network logon faults

The engine has two parameters related to the way faults are handled.  In general there is a distinction between Script syntax errors and runtime errors:

If an error-handler Script file (called ErrorHandler.fsh) exists in the same directory as the engine, it gets executed when a fault occurs.

The error-handler Script is especially useful with logon Scripts.  Creating the single line shown in Figure 2.1 in the Script ErrorHandler.fsh appends all logon execution errors for all Users on a network to a log file (in this example, called NetworkErrors.log in shared folder ITShare).

This single FSH command provides a comprehensive overview in one file of all logon errors occurring on a network.

Figure 2.1 Sample line in ErrorHandler.fsh

ss_append 

The FSH Engine is provided in the download package.

< back >

 

The FSH Editor

About the editor

The FSH Editor is an integrated development environment (IDE), with a standard and familiar look-and-feel, similar to Microsoft’s Visual Studio.  Among the features supported by the editor are keyword recognition, syntax highlighting, context-sensitive help and guided completion.

Figure 2.2 shows a typical screen view of the FSH Editor:

Figure 2.2 The FSH Editor

 

ss_editor

 

The first time the FSH Editor is started, a demo Script is opened, which can be run from within the editor by pressing function key F5.  The demo Script showcases some of the many capabilities provided by FastTrack Scripting Host 2010.

As well as executing a Script from within the editor using F5, a Script can be run in debug mode using F6.  Running in debug mode enables a Script Writer to step through the Script and see exactly how it will be interpreted at runtime.

The FSH Editor is provided in the download package.

 

Elements of the editor
Figure 2.3 The FSH Editor Property Builder
ss_propertybldr

 

 

Features of the editor
ss_dockingprops

< back >

Kawasaki

Comparing FSH Editor Features

Language comparison for Script editor features

The FSH Editor has many more features than are provided natively with VBScript and PowerShell.  Figure 2.5 compares the features of all three products.

Figure 2.5 Working with Scripts using FSH, VBScript and PowerShell
ss_sediting

< back >

 

FastTrack Logon

About FastTrack Logon

FastTrack Logon replaces logon .bat and .cmd files, and can also replace .wsh Scripts.  Users logging on see a customizable graphics screen and run a powerful set of commands, all without requiring deployment to the client computers.

All that is needed is a 50kb FastTrack Logon file FTLogon.exe in the domain NetLogon directory and an update of User profiles to point logon Script to this executable.  FastTrack Logon then automatically distributes the FSH Engine and all Scripts to client computers for execution when Users log on.  FastTrack Logon can also be configured via Group Policy and Active Directory for large numbers of Users in enterprise or department groups.

FastTrack Logon is very simple and it works for all 32-bit and 64-bit Windows operating systems; desktop operating systems (Windows NT4/2000/XP/Vista/7), server operating systems (Windows Server 2000/2003/2008) and terminal server and Citrix sessions.

How does it work?

The process is straightforward – extract all files from FTLogon.zip into the NetLogon share on the domain controller and point the Users' logon Scripts to FastTrack Logon.  When it is executed, it will do the following on each client computer:

<!--[if !supportLists]-->·         <!--[endif]-->Synchronize the engine Fsh.Exe and logon Script files to Local Settings\Application Data\FastTrack in each User’s non-roaming part of the profile.

<!--[if !supportLists]-->·         <!--[endif]-->Execute the predefined logon Scripts from this client location.

<!--[if !supportLists]-->·         <!--[endif]-->Associate the .fsh extension to the profile copy of Fsh.exe.

The first time each User logs on to a client computer, about 1 MB of data is copied from the domain controller to the non-roaming part of the User’s profile.  After that, copying happens only when the files in the fshbin folder are changed on the domain controller – anything put into the fshbin directory on the domain controller will be synchronized to each client computer.

There is no limitation on the files and directories that can be put under fshbin on the domain controller.  A Windows Active Directory is not a requirement; FastTrack Logon also works for domains without Active Directory.

The local copy of the files and the file association is per User, because this way no further work is required for client computers to support FSH Scripts in general in each User’s context.  There is no need for a per-machine deployment and the User is not required to be a local administrator.  The client location of files can be customized, if they need to be placed somewhere else.

File and folder structure

The FastTrack Logon package is a compressed zip file called FTLogon.zip, installed by default into <Program Files>\FastTrack Software\FastTrack Scripting Host when FSH 2010 is installed.  It contains the FastTrack Logon program FTLogon.exe, SmartDock and the sample Scripts.

When installation is complete, including obtaining a license file and extracting the FastTrack Logon package, the following two file and folder structures are created (assuming default installation locations).

1. Folder <Program Files>\FastTrack Software\FastTrack Scripting Host

This structure is created after running the installation program Setup.exe and applying a license file:

<!--[if !supportLists]-->·         <!--[endif]-->DemoScript.fsh

<!--[if !supportLists]-->·         <!--[endif]-->Editor.exe

<!--[if !supportLists]-->·         <!--[endif]-->Fsh.exe

<!--[if !supportLists]-->·         <!--[endif]-->Fsh.lic

<!--[if !supportLists]-->·         <!--[endif]-->Fsh.pk

<!--[if !supportLists]-->·         <!--[endif]-->FTLogon.zip

2. Share name \\<Domain Server>\NetLogon

This structure is created after extracting FTLogon.zip into the domain NetLogon share and copying the license file into the fshbin folder:

<!--[if !supportLists]-->·         <!--[endif]-->Fshbin (folder)

<!--[if !supportLists]-->§  <!--[endif]-->ErrorHandler.fsh

<!--[if !supportLists]-->§  <!--[endif]-->Fsh.exe

<!--[if !supportLists]-->§  <!--[endif]-->Fsh.lic

<!--[if !supportLists]-->§  <!--[endif]-->PostInstall.fsh

<!--[if !supportLists]-->§  <!--[endif]-->PostLogon.fsh

<!--[if !supportLists]-->§  <!--[endif]-->PostUninstall.fsh

<!--[if !supportLists]-->§  <!--[endif]-->PreLogon.fsh

<!--[if !supportLists]-->§  <!--[endif]-->SmartDock.exe

§  SmartDock.fsh

<!--[if !supportLists]--><!--[endif]-->

<!--[if !supportLists]-->·         <!--[endif]-->FTLogon.exe

·         ftlogon.ini

<!--[if !supportLists]--><!--[endif]-->

< back >

 

SmartDock

About SmartDock

SmartDock is a small executable program, called SmartDock.exe, which detects whenever the IP settings of any network adapter change on a computer.

In programming jargon, an IP address settings change is known as an event – once such an event is detected, SmartDock can execute a Script called SmartDock.fsh.

SmartDock can run in any of the following scenarios:

For any event where IP settings change, SmartDock.exe runs and triggers the execution of SmartDock.fsh.

Why is SmartDock useful?

Users of portable computers often put their computers into standby or hibernation at one location and then resume the session somewhere else, such as moving from a work network to a home environment.

With SmartDock, both Users and Network Administrators have control over what happens every time the computer is resumed or connects to a network.  The SmartDock tool is a good supplement to domain logon Script for portable computers.

Running SmartDock

What actually happens when SmartDock executes (i.e. when the commands and functions in SmartDock.fsh are interpreted) is entirely up to the Script Writer.

A SmartDock Script is no different from any other FSH Script – the default name of SmartDock.fsh simply means that it is the Script executed when SmartDock.exe is triggered.

SmartDock is useful for portable computers that roam.  Setting or removing proxy server settings based on whether or not the computer is on a LAN would be one thing to do instead of using the Internet Explorer auto detection mechanism.  Another use could be connecting or disconnecting common shares and local printers.  Think of the SmartDock Script as an offline supplement to the logon Script.

An executable program, not a service

SmartDock is not a Windows Service but a small executable file.  The reason for this is simple; if it was a Windows Service, it could not run in the User's context and then it would be worthless to both Users and Network Administrators.  It would be impossible to set proxy server settings, changing default printers and all the other things that are related to a particular User.

A sample SmartDock Script is included later in this chapter under Sample Scripts.

SmartDock is provided in the download package.

< back >

Sample Scripts

Included in the download package

Several sample Scripts are provided in the download package for FSH 2010.  As well as the demo Script, these include a sample logon Script (both pre- and post-Windows explorer service), several installation Scripts, an error-handling Script and a SmartDock Script.

Demo Script

DemoScript.fsh

ss_demoscripttxt

< back >

 

Logon Scripts
Pre-Windows explorer.exe process

PreLogon.fsh

 

ss_prelogtxt

 

Post-Windows explorer.exe process

PostLogon.fsh

 
ss_postlogtxt

 

 
Installation Scripts

PostInstall.fsh

ss_postinstalltxt

 

PostUninstall.fsh

ss_postuninstalltxt

 

Error-handling Script

ErrorHandler.fsh

ss_errorhandletxt

  

SmartDock Script

SmartDock.fsh

ss_smartdocktxt

< back >

  <<< For more, please consult Chapters 2 & 4 of the FastTrack Users Guide. >>>

footer_left   footer_right
spacer
spacer