Geeks With Blogs

News





INauseous() Shawn Cicoria - Solution Architect, Craftsman and Artisan - INauseous() - Main Blog Here: www.Cicoria.com

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

wsscmd 

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
link.Save

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

Posted on Thursday, July 24, 2008 3:13 PM Utilities , SharePoint | Back to top


Comments on this post: Creating a WSS / MOSS Command Prompt on the Desktop

Comments are closed.
Comments have been closed on this topic.
Copyright © Shawn Cicoria | Powered by: GeeksWithBlogs.net