| Finally today I bit the bullet and finally got sick of this annoyance which has plagued me time after time. Each time you install a new SharePoint Box, one if the first things i find myself dong is always putting the path to STSADM in the path environment variable. Start –> Control Panel –> System –> Advanced -> Environment Variables –> Locate Path –> Edit… and then that's only to just GET to the environment variables, getting the 12 Hive location is just as big of a pain! So today, I decided on a new approach… VBScript! (Even tho C# > VB!) My VB Script will append the 12 Hive Path onto it, simply, easy, repeatable! ' Title : Updated the SYSTEM Path environment variable to include ' the 12 Hive BIN Folder ' Created : 03/08/2009 ' Author : Daniel Brown (Blog: http://www.danielbrown.id.au/) ' ========================================================== ' Variables Dim SystemEnviroment, ShellInstance
' Create the Shell Object Set ShellInstance = CreateObject("Wscript.Shell")
' Get the SYSTEM envrioment object Set SystemEnviroment = ShellInstance.Environment("SYSTEM")
' Retrive the string representation of the PATH Environment variable strPath = SystemEnviroment("Path")
' Append the 12 Hive path to the existing PATH Environment variable SystemEnviroment("Path") = strPath & ";%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN"
' Release Objects Set SystemEnviroment = Nothing Set ShellInstance = Nothing
' Completed WScript.Echo "PATH Environment variable has been updated to : " & strPath
You can download the text version here
I know its not perfect, but please be kind, I’m a C# Developer! :) |