The company I work for has a mixture of Windows NT Workstation and Windows NT Server 4.0, Terminal Server Edition (WTS) users. On our Nine-Terminal-Server farm, we publish Microsoft Word to approximately 300 users. We made some simple changes to the master normal.dot Word template. (This custom Visual Basic for Applications—VBA—template adds itself to Word as a menu option.) We then needed to copy this template to \servername\master.tsprofiles\username\Application Data\Microsoft\templates. (The master.tsprofiles folder holds all the WTS users' profiles.)
I wrote the script that Listing 1 shows to obtain the users' profile folder names that needed the updated template. This script loops through the master.tsprofiles folder and returns the names of all the subfolders (i.e., the names of the users' profiles).
Next, I wrote the script that Listing 2 shows to copy the modified master template to the \servername\master.tsprofiles\username\Application Data\Microsoft\templates folder. To run this script, you need to make sure that the username.txt file and the normal.dot Word template are on the computer's C drive. The script replaces the %i variable with %username% from the text file username.txt in Listing 1.
After we ran these two scripts, our problem was solved. We were able to update the normal.dot template in all the users' profiles in \servername\master.tsprofile\username\Application Data\Microsoft\templates.