'Harlan Brumm, Product Support Technical Lead Revit Architecture - Product Support 'Autodesk, Inc. 2010 'This Script is designed to delete the Comm Center XML and process that can Prevent Autodesk Revit Architecture 2011 from Launching at startup. See blog post for more details: http://revitclinic.typepad.com/my_weblog/2010/07/revit-2011-hangs-at-splash-screen-or-crashes-with-unrecoverable-error.html Option Explicit 'On Error Resume Next DIM strComputer DIM objShell DIM LogonUserName DIM objFLO DIM strFilePathXML DIM strNewFileXML DIM strFilePathUI DIM strNewFileUI DIM strXMLStart DIM strXMLTitle DIM intXML DIM regLogonUserName DIM objWMI DIM objFile DIM filesys DIM strProcessToKill DIM objWMIService DIM colProcess DIM objProcess DIM count DIM strWSD DIM strWSDT DIM intWSD DIM strTWS DIM strTWST DIM intTWS DIM WshNetwork DIM fname DIM RevitName 'Setting up Presets and determine using login name strComputer = "." strXMLStart = "WARNING!! This script deletes a file and terminates a process on your computer. Ensure that you run this script with ADMIN privileges. Do You Wish to Continue?" strXMLTitle = "Communication Center Causing Revit to Hang" intXML = 4 '4 is yes/no 3 is yes/no/cancel intXML = MsgBox(strXMLStart, vbYesNo+VBQuestion,strXMLTitle) If intXML = vbYes Then Do fname = inputbox("Enter the Name of Revit product to fix. Type either: Architecture, Structure, or MEP below ") If fname = "Architecture" then Wscript.Echo "Autodesk Revit Architecture 2011 will be Fixed" RevitName = "Autodesk Revit Architecture 2011" Exit Do ElseIf fname = "Structure" then Wscript.Echo "Autodesk Revit Structure 2011 will be Fixed" RevitName = "Autodesk Revit Structure 2011" Exit Do ElseIf fname = "MEP" then Wscript.Echo "Autodesk Revit MEP 2011 will be Fixed" RevitName = "Autodesk Revit MEP 2011" Exit Do ElseIf fname = "" then Wscript.Quit Else Wscript.Echo "Product Not recongized. Try again." End If Loop Set WshNetwork = WScript.CreateObject("WScript.Network") LogonUserName = WshNetwork.UserName 'WScript.Echo "Current User Name: " & LogonUserName Set objFLO = CreateObject("Scripting.FileSystemObject") 'Verifying Vista or XP and setting correct paths for WSCommCntrData.xml If objFLO.FolderExists ("C:\Users") Then strFilePathXML = "C:\Users\" & LogonUserName & "\Appdata\local\Autodesk\Revit\" & RevitName & "\ENU\Components\WebServices\WSCommCntrData.xml" Else strFilePathXML = "C:\Documents and Settings\" & LogonUserName & "\Local Settings\Application Data\Autodesk\Revit\" & RevitName & "\ENU\Components\WebServices\WSCommCntrData.xml" End If 'Wscript.Echo "This Script will delete " & StrFilePathXML 'Deleting WScommCntrData.xml strWSD = "This will delete the WScommCntrData.xml. Do you wish to continue?" strWSDT = "Deleting WScommCntrData.xml" intWSD = 4 '4 is yes/no 3 is yes/no/cancel intWSD = MsgBox(strWSD, vbYesNo+VBQuestion,strWSDT) If intWSD = vbYes Then Set filesys = CreateObject("Scripting.FileSystemObject") If filesys.FileExists(strFilePathXML) Then filesys.DeleteFile strFilePathXML Wscript.Echo "File WSCommCntrData.xml Deleted" Else Wscript.Echo "WSCommCntrData.xml does not exist" End If Else WScript.Echo "Deleting WScommCntrData.xml Canceled" End If 'Ends the wscommcntr2.exe Process strTWS= "This will terminate the wscommcntr2.exe processes. Do you wish to continue?" strTWST = "Deleting WScommCntrData.xml" intTWS = 4 '4 is yes/no 3 is yes/no/cancel intTWS = MsgBox(strTWS, vbYesNo+VBQuestion,strTWST) If intTWS = vbYes Then strComputer = "." strProcessToKill = "wscommcntr2.exe" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = '" & strProcessToKill & "'") count = 0 For Each objProcess in colProcess objProcess.Terminate() count = count + 1 Next Wscript.Echo "Killed " & count & " instances of " & _ strProcessToKill WScript.Echo "Script Complete" Else WScript.Echo "Terminating wscommcntr2.exe Canceled" WScript.Echo "Script Complete" End If Else WScript.Echo "Script Canceled" End If