Announcement

Collapse
No announcement yet.

Symantec uninstall script for custom python procedure

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Symantec uninstall script for custom python procedure

    Hi C1 team,
    I am trying to create a bulk Symantec uninstall script and push it out through a custom python procedure profile.

    Is this possible?

    Thoughts on the code below?

    ' Script START
    const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."

    Set oReg=GetObject("winmgmts:{impersonationLevel=imper sonate}!" &_
    strComputer & "\root\default:StdRegProv")

    strKeyPath = "Symantec\Microsoft\Windows\CurrentVersion\Uni nsta ll"
    oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

    Dim path
    Dim command

    Dim clear
    clear="Symantec\Microsoft\Windows\CurrentVersion\U ninstall"

    For Each subkey In arrSubKeys

    strKeyPath=strKeyPath + "" + subkey +""

    strValueName = "DisplayName"

    oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
    strValueName,strValue

    if strvalue="Symantec Endpoint Protection" then

    strValueName = "UninstallString"

    oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
    strValueName,strValue

    command=strValue

    End if

    strKeyPath=clear

    Next

    command=Replace(command,"MsiExec.exe /I","MsiExec.exe /X")
    command=command + " " + "/passive"

    Dim WshShell
    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run command

    ' Script END

  • #2
    Hello Trip Nine ,

    We will contact you over email to discuss this issue.

    Comment


    • #3
      import os;
      import re;
      import subprocess;
      k=[];
      guid=os.popen('C:\\Windows\\System32\\WindowsPower Shell\\v1.0\\powershell.exe "get-wmiobject Win32_Product | Format-Table Name,IdentifyingNumber" | findstr /i /c:"Symantec Endpoint Protection"').read();
      print(guid)
      k.append(re.findall("{.*",guid));
      j=[];
      for i in k[0]: j.append(i);
      print j;
      for i in j: os.system('msiexec.exe /x '+i+' /quiet REBOOT=ReallySuppress REMOVE=ALL');

      Comment

      Working...
      X