Jump to content

Recommended Posts

Posted

I need to remove all already installed VNC programs (RealVNC, TightVNC, UltraVNC) into Windows 10/11clients so I'd like to create my script to uninstall ones.

Can I run PowerShell command via autoIt ? Suggestions to reach target?

Posted

TBH the language is probably the last thing to worry about... If you're using powershell there's probably no need to use AutoIt to fire it up.  You can, but why not just do the whole thing in powershell?

I'd say the work will be more in finding how each product is installed so you can craft a (presumably silent) uninstall string for each.  I haven't looked into the installers for these, but if there's msis involved they'll have different product codes for different versions. Or maybe some might offer an msi or exe install for the same product... Or maybe some were installed machine-wide and others under the users' profile..

So if you're dealing with that nightmare,  I'd probably write something to search through these Keys and their equivalent in the HKCU hive as a starting point: That is where you should find the relevant installer paths/product codes etc etc.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

 

Posted
  On 1/3/2025 at 7:41 AM, MattyD said:

I haven't looked into the installers for these, but if there's msis involved they'll have different product codes for different versions. Or maybe some might offer an msi or exe install for the same product...

Expand  

I'd like to make it by AutoIt, I find out It's necessary this string to remove Ultravnc :

Local Const $1 = "C:\Program Files\uvnc bvba\UltraVNC\"
Local Const $2 = "unins000.exe"

 $1\$2 /VERYSILENT /NORESTART /LOG

How can I write AutoIt code line to execute It ?

  • Developers
Posted
  On 1/10/2025 at 12:29 PM, CutterButter said:

How can I write AutoIt code line to execute It ?

Expand  

Open the helpfile and I am sure you find the information there, or do you prefer to be spoon-fed? ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Hi,

this is a script I wrote a couple of years ago, should give you a quite good start to solve your task.

Pls. use deepl.com yourself to translate the German parts to your language.

 

Uninstall-Search-Substring-SortByDate.au3

#include <array.au3> ; required just for the _arraydisplay()
#include <file.au3>
#include <Debug.au3>



If @OSArch = "x64" Then
    $BitPre = "HKLM64|HKLM"
Else
    $BitPre = "HKLM"
EndIf




$Search=InputBox("Installierte Software durchsuchen und anzeigen","Zum Eingrenzen SubString DisplayName eingeben, nichts eintragen für vollständige Suche")
if $Search="" then $Search = False



$Str4ArrayAdd = ""

For $HKLM In StringSplit($BitPre, "|", 2)

    ConsoleWrite("32-64-bit: " & $HKLM & @CRLF)
    $i = 0
    While 1
        $i += 1
        $UnInst = RegEnumKey($HKLM & "\Software\microsoft\windows\currentversion\uninstall", $i)
        If @error Then ExitLoop
        ConsoleWrite($HKLM & @TAB & $UnInst & @CRLF)
        If $Search Then ; Wenn als Parameter 1 ein String eingegeben wurde, dann nur solche Produkte in die Ergebnisse aufnehmen, die diesen String im DisplayName enthalten
            If Not StringInStr(RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "DisplayName"), $Search) Then ContinueLoop
        EndIf
        $Str4ArrayAdd &= RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "InstallDate") & "|"
        $Str4ArrayAdd &= $HKLM & "|"
        $Str4ArrayAdd &= RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "DisplayVersion") & "|"
        $Str4ArrayAdd &= RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "DisplayName") & "|"
        $Str4ArrayAdd &= RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "UninstallString") & "|"
        $Str4ArrayAdd &= RegRead($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "InstallSource") & "|"
        Switch $HKLM
            Case "hklm"
                $Str4ArrayAdd &= StringReplace($HKLM & "\Software\microsoft\windows\currentversion\uninstall\" & $UnInst, "HKLM\SOFTWARE\", "HKLM\SOFTWARE\WOW6432Node\") & @CRLF
            Case "hklm64"
                $Str4ArrayAdd &= "HKLM\Software\microsoft\windows\currentversion\uninstall\" & $UnInst & @CRLF
        EndSwitch
    WEnd
Next

ConsoleWrite("###############################################################################################################" & @CRLF)
ConsoleWrite($Str4ArrayAdd & @CRLF)
ConsoleWrite("###############################################################################################################" & @CRLF)
$Str4ArrayAdd = StringTrimRight($Str4ArrayAdd, 2) ; cut off final @CRLF

Dim $a2ProdArr[1][7]
_ArrayAdd($a2ProdArr, $Str4ArrayAdd)
_ArraySort($a2ProdArr,1, 1)
$a2ProdArr[0][0] = "InstallDate"
$a2ProdArr[0][1] = "HKLM/HKLM64"
$a2ProdArr[0][2] = "DisplayVersion"
$a2ProdArr[0][3] = "DisplayName"
$a2ProdArr[0][4] = "UninstallString"
$a2ProdArr[0][5] = "InstallSource"
$a2ProdArr[0][6] = "Registry Uninstall Key"

_DebugArrayDisplay($a2ProdArr)

 

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...