VBS 强制关闭Symantec Endpoint Protection的代码

2019-01-15 23:02:48王冬梅

        While objOrgIni.AtEndOfStream = False
                strLine = Trim( objOrgIni.ReadLine )
                If blnWritten = False Then
                        If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
                                blnSectionExists = True
                                blnInSection = True
                        ElseIf InStr( strLine, "[" ) = 1 Then
                                blnInSection = False
                        End If
                End If

                If blnInSection Then
                        If blnKeyExists Then
                                intEqualPos = InStr( 1, strLine, "=", vbTextCompare )
                                If intEqualPos > 0 Then
                                        strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
                                        If LCase( strLeftString ) = LCase( strKey ) Then
                                                ' Only write the key if the value isn't empty
                                                ' Modification by Johan Pol
                                                If strValue <> "<DELETE_THIS_VALUE>" Then
                                                        objNewIni.WriteLine strKey & "=" & strValue
                                                End If
                                                blnWritten   = True
                                                blnInSection = False
                                        End If
                                End If
                                If Not blnWritten Then
                                        objNewIni.WriteLine strLine
                                End If
                        Else
                                objNewIni.WriteLine strLine
                                        ' Only write the key if the value isn't empty
                                        ' Modification by Johan Pol
                                        If strValue <> "<DELETE_THIS_VALUE>" Then
                                                objNewIni.WriteLine strKey & "=" & strValue
                                        End If
                                blnWritten   = True
                                blnInSection = False
                        End If
                Else
                        objNewIni.WriteLine strLine
                End If
        Wend