Logon Script Generator 1.4 This HTA is designed in the "scriptomatic" approach with the goal of rapidly producing VBScript code with minimal scripting. The function of most logon scripts is to map network resources such as file shares and printer, often based on group membership. This tool simplifies that process. The HTA requires two text files, drives.txt and printers.txt Sample versions are included. You will need to modify them for your environment. Drives.txt should contain the UNC path of all the file shares that you might want to map in a logon script. You can use %username% as part of a drive mapping UNC. Printers.txt is the list of network printer shares you might want to map. By default the tool will look for the files in the same directory as this HTA. However you can select alternate files. Click the Show config button and then Get File. Last settings used are stored in HKCU\Software\SAPIEN Technologies, Inc.\LogonScriptGenerator. When you start the HTA, these files are read into drop down lists. For drive mappings, select the drive letter and UNC from the drop down lists. If you want the drive mapping to happen on the basis of group membership, you can select a group from the dropdown list. This list is populated on startup by using the LDAP ADSI provider to query Active Directory for all security-enabled groups. If you don't want to use group membership, don't select any group or use Domain Users. Use the Add Drive button to add the selection to your script. Repeat for as many drive selections as you would like. Follow the same process with network printers. Check "make default" if you want a specific printer set as default. If you check this box on more than one printer, the last one you checked will probably be set as default. You shouldn't have to use the legacy add printer section unless you have applications that require a printer mapped to a port like LPT1. The script has the option to display a summary popup with a variety of information. You also display a short message. You can display how old the user's password is. You can display a summary of mapped printers and drives. The message will display for 10 seconds by default but you can change that. Setting the timeout to -1 will force the user to click OK otherwise it will automatically close after the specified number of seconds. During drive and printer mappings, you can elect to display an error message should there be a failure or error. In addition to specific error information, you can also include a brief message such as directions to call the help desk. If you have the need to run additional scripts or command line tools, you can enter them in the Additional Commands section. Put each command on it's own line. These will be run with the Exec method synchronously. The Script Comments section is for the header of your script. You can enter additional comments if you'd like. Click the Create Script button to preview the code or Clear Selections if you want to start again. There is no way to see what you've already added until you click Create Script. This will display the final script and hide the configuration elements. After the script is saved you can open it in a script editor for further revision. If you have Primal Script 4.1, it will be detected and the script will open with Primal Script. Otherwise it will open in Notepad. This HTA is not an editing tool, just a code creator. If you want to start completely over after viewing the produced code, you can click Reset button. You can edit directly in the HTA to tweak the code. When ready, click the Save File button and save your vbs script. You should test it thoroughly before rolling it out into production. There is popup help for most elements if you hover your mouse over them. If necessary for troubleshooting, you can turn on the tracing debug feature Under Config. This will launch a separate Internet Explorer Window for trace messages. If you check this box, the tool will refresh and any logon script settings you have made will be lost, so do this first if you are debugging. Use the Quit button to close the tool when you are finished. This will properly clean up any temporary elements and update the registry properly. This is especially important if you turn debug tracing on. Requirements: Windows XP Professional computer that belongs to an Active Directory domain. Change History: v1.4 November 27, 2006 Modified registry path for saving values Added functionality to turn on/turn off debugging from the config Fixed popup help v1.3 November 21, 2006 Added functionality to configure location of drives.txt and printers.txt Added functionality to load welcome message from a text file. Added functionality to load Error message from a text file. Added functionality to edit saved script in PrimalScript 4.1 if it is installed otherwise you can open it in Notepad. v1.2 November 20, 2006 Added debug functionality v1.1 October 6, 2006 Corrected errors when specifying a path like \\file01\%username%$ Corrected errors if %username% was not in lower case. Now any case will work. v1.0 April 13, 2006 Original Release **************************************************************** * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE * * TESTED IN A SECURED LAB ENVIRONMENT. USE AT YOUR OWN RISK. * * **************************************************************** Jeffery Hicks jhicks@SAPIEN.com http://www.primalscript.com/freetools/