Код:

Option Explicit
Const ForReading = 1
Const ForAppending = 8
Const TristateTrue = -1
Dim strPattern
Dim strSourceFile
Dim strContent
strPattern = "CommonCfgLocation=\\SQLSERVER\Common1C\1CESCmn.cfg"
strSourceFile = WScript.CreateObject("WScript.Shell").ExpandEnvironmentStrings("%AppData%\1C\1CEStart\1CEStart.cfg")
With WScript.CreateObject("Scripting.FileSystemObject")
If .FileExists(strSourceFile) Then
With .OpenTextFile(strSourceFile, ForReading, False, TristateTrue)
strContent = .ReadAll()
.Close
End With
If Not InStr(1, strContent, strPattern, vbTextCompare) > 0 Then
With .OpenTextFile(strSourceFile, ForAppending, False, TristateTrue)
.WriteBlankLines 2
.WriteLine strPattern
.Close
End With
End If
Else
WScript.Echo "Can't find source file [" & strSourceFile & "]."
WScript.Quit 1
End If
End With
WScript.Quit 0