2010 Scripting Games: Advanced Event 4–Creating an Environmental Variable
Note: We are no longer accepting entries for this event. See the due dates page for a list of all event due dates.
About This Event
Date of Event
April 29, 2010
May 6, 2010
Your company has just purchased a rather expensive enterprise-wide networked application. The application consists of a server back end and a client front end. After the server back end application has been installed, updated, and configured to listen on the appropriate ports, the client application is deployed using your network deployment application. Unfortunately, the client application installer failed to create a specific system environmental variable that is used to check for client licensing before allowing the client to launch. This was not discovered until the package had been fully deployed. In a panic, you boss calls you and asks if you can create a script that will read a text file of computer names that have been licensed for the application, and create the new environmental variable. The environmental variable is shown here:
The new environmental variable is seen in the following image.
· Your script should allow for any environmental variable, system, or user. It should also allow the user to specify a specific name and value.
; Your script should check to see if the environmental variable already exists. If it does, it should prompt to override by displaying the current value.
· Your script should also provide a silent mode—just create the variable and assign a new value, with no questions asked. But it should create a log of computers that already had the variable, with the previous setting.
· Your script should create a log that lists all the computers that were successfully modified, and include the date and time when the modification was made.
2010 Scripting Games Links
Ed Wilson and Craig Liebendorfer, Scripting Guys