VBS 强制关闭Symantec Endpoint Protection的代码

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

        If objFSO.FileExists( strFilePath ) Then
                Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False, TristateTrue )
                Do While objIniFile.AtEndOfStream = False
                        strLine = Trim( objIniFile.ReadLine )

                        ' Check if section is found in the current line
                        If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
                                strLine = Trim( objIniFile.ReadLine )

                                ' Parse lines until the next section is reached
                                Do While Left( strLine, 1 ) <> "["
                                        ' Find position of equal sign in the line
                                        intEqualPos = InStr( 1, strLine, "=", 1 )
                                        If intEqualPos > 0 Then
                                                strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
                                                ' Check if item is found in the current line
                                                If LCase( strLeftString ) = LCase( strKey ) Then
                                                        ReadIniUnicode = Trim( Mid( strLine, intEqualPos + 1 ) )
                                                        ' In case the item exists but value is blank
                                                        If ReadIniUnicode = "" Then
                                                                ReadIniUnicode = " "
                                                        End If
                                                        ' Abort loop when item is found
                                                        Exit Do
                                                End If
                                        End If