Creating a WSS / MOSS Command Prompt on the Desktop

UPDATED: 8/6/2008 - Minor issue on Path

I've built quite a few WSS / MOSS machines and one task that I always seem to do is create a simple CMD shell prompt on the desktop (quick launch, etc.) that gives me easy access to STSADM and has the path set correctly.  So in the interest of saving time I've created a simple VBScript file located here as well as the full listing below


Set Shell = CreateObject("WScript.Shell")
Set Env = Shell.Environment("PROCESS")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\WSS CMD.lnk")

cssHive = Env("CommonProgramFiles") & "\Microsoft Shared\web server extensions\12"
currentPath = RTrim(Replace(WScript.ScriptFullName, WScript.ScriptName, ""))
envBatFile = "setWssPath.cmd"

CreateBatFile currentPath & setWssPath & envBatFile, cssHive

link.Arguments = "/k " & " " & Chr(34) & currentPath & envBatFile & Chr(34)
link.Description = "WSS Command Prompt"
link.HotKey = "CTRL+SHIFT+W"
link.IconLocation = "%SystemRoot%\system32\SHELL32.dll,94"
link.TargetPath = "%comspec%"
link.WindowStyle = 1
link.WorkingDirectory = cssHive

Sub CreateBatFile(fileName, cssHive)
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set file = fso.CreateTextFile(fileName, True)
    file.WriteLine("@SET PATH=%PATH%;" & cssHive & "\bin")
    file.WriteLine("@ECHO WSS CMD Shell - Shawn Cicoria")

End Sub