Jump to content

Recommended Posts

Posted

I am trying to uninstall  a voip program installed on my domain windows end devices. They have a uninstall.exe file to remove , but it doesn't have a silent mode option , so I have to automate it . I run the  following script , but it requires the Admin creds if the Uninstall.exe file is in Program Files folder. At this point the script is getting paused. Can anyone please help..?

 

Local $ProgramFilePath= "C:\Program Files (x86)\Bell Canada\Bell Total Connect\Uninstall.exe"
Local $userHomeDir = @UserProfileDir
Local $DocDirPath=$userHomeDir & "\Documents\Bell Canada\Bell Total Connect\Uninstall.exe"
Local $runPath=""

If FileExists($ProgramFilePath) Then 
    
    ProcessClose("Communicator.exe")
    $runPath=$ProgramFilePath
    RunAs ("Administrator","","<password>", 0,$runPath)
    
    WinActivate("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    WinActivate("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:4]")
    WinActivate("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    WinActivate("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    WinActivate("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    Exit
    
    
ElseIf FileExists($DocDirPath) Then
    ProcessClose("Communicator.exe")
    Sleep(1000)    
    $runPath=$DocDirPath
    Run($runPath)
        
    WinWaitActive("Bell Total Connect Uninstall")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:4]")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    ControlClick("Bell Total Connect Uninstall","","[CLASS:Button; INSTANCE:2]")
    Sleep(1000)
    MsgBox(0, " Information ", " Bell Total Connect software  is successfully removed from your  system, Please press OK to continue")
    
    Exit
    
    
Else
    
MsgBox(0, " Information ", " Bell Total Connect is not  present in your system, Please press OK to continue")

EndIf

Exit
    

 

Regards

Manoj Joseph

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...