Jump to content

Read array into registry


Recommended Posts

Yeah that works for me, im going to have a play and see what i can make it do, it didnt occur to me that i had to do them the other way round till later in the day and i was too busy at work to test it

Ill get it doing some simple stuff and ive got some extra code for msi to add etc

Many thanks to all for your help

Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You're welcome. :)

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Getting this working well now

Small follow on question though

Sometimes the registry key exists more than once is there a way to make it only use the first one it finds?

sometimes it tries to do a second uninstall after its already uninstalled because the machine hasnt been restrated to remove the idea that the program is stilll there

what would be the best way to achieve that?

And for any that find it usefull here is a working version although i havent quite got the error stuff working right yet

#include <Array.au3> ; For ArrayDisplay
#include <MsgBoxConstants.au3>
Global $sRegKey, $sRegPath, $sDisplayName, $Uninstall, $UninstallPath
;~          CCleaner|Defraggler|Spybot Search And Destroy 1.62|Malwarebytes Anti-Malware
$sRegKey = 'CCleaner|Defraggler|{A92DAB39-4E2C-4304-9AB6-BC44E68B55E2}|Malwarebytes Anti-Malware_is1|'

Global $aRegKeys = StringSplit($sRegKey, "|")
;~ _ArrayDisplay($aRegKeys)

$sRegPath = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\|' & _
            'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\|' & _
            'HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\|' & _
            'HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\|' & _
            'HKCU64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'

Global $aRegPath = StringSplit($sRegPath, "|")
;~ _ArrayDisplay( $aRegPath)

For $regloop = 1 To $aRegPath[0]
    For $keyloop = 1 To $aRegKeys[0]
        Select
;~ =================================================
            Case _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") = 1
                $sDisplayName = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "DisplayName")
                $UninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString")
                If StringInStr($UninstallPath, 'MsiExec.exe', 1) Then
                    $Uninstall = RunWait($UninstallPath & ' /qb')
                    If @error < 0 Then MsgBox($MB_OK, 'Uninstall Error', $sDisplayName & " Didn't Uninstall Correctly")
                    ConsoleWrite($Uninstall & @CRLF)
                Else
                    $Uninstall = ShellExecuteWait($UninstallPath, '/S')
                    If @error < 0 Then MsgBox($MB_OK, 'Uninstall Error', $sDisplayName & " Didn't Uninstall Correctly")
                    ConsoleWrite($Uninstall & @CRLF)
                EndIf
                ConsoleWrite($UninstallPath & @CRLF)
;~ =================================================
            Case _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") = 1
                $UninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString")
                If StringInStr($UninstallPath, 'MsiExec.exe', 1) Then
                    $Uninstall = RunWait($UninstallPath & ' /qb')
                    If @error < 0 Then MsgBox($MB_OK, 'Uninstall Error', $sDisplayName & " Didn't Uninstall Correctly")
                    ConsoleWrite($Uninstall & @CRLF)
                Else
                    $Uninstall = ShellExecuteWait($UninstallPath, '/S')
                    If @error < 0 Then MsgBox($MB_OK, 'Uninstall Error', $sDisplayName & " Didn't Uninstall Correctly")
                    ConsoleWrite($Uninstall & @CRLF)
                EndIf
                ConsoleWrite($UninstallPath & @CRLF)
;~ =================================================
        EndSelect
    Next
Next
MsgBox($MB_OK, 'Complete', " Programs Have Been Removed ")

Func _IsRegistryExist($sKeyName, $sValueName) ; False = Doesn't Exist / 0 / True = Exists / 1 [Author guinness]
    RegRead($sKeyName, $sValueName)
    Return @error = 0
EndFunc   ;==>_IsRegistryExist
Edited by Chimaera
Link to comment
Share on other sites

Does it find more than "QuietUninstallString" and "UninstallString"?

or does it find one of those in more than one place?

The basic idea i would try would be: When i get to the uninstal execution, add the, let's call it "object", into a list, and whenever i get to the next uninstall command, seach for the string in that list to see if it's repeated, then, proceed, or not. 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

It finds the keys more than once on different uninstall sections

Its the same uninstall key just represented in more than one place on the registry

I was debating about adding them to an array or ini, and sort it from there maybe then uninstall all the occurences at the end when the loops are finished, i guess that would also give me a check on whats being found as i can show the array or ini for checking if i get a prob

Maybe..

Link to comment
Share on other sites

Think this is all about doing things by ourselves if we can.

Where's the fun in just use whatever someone else has done?

@chimaera: Good idea.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

True, but then this thread has been going on for quite some time now.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I didn't mean it like that, sorry. Just careca a shouldn't look a gift horse in the mouth.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

True, but then this thread has been going on for quite some time now.

 

True, but then i didn't think there was a time limit per thread. :P

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

So where do you stand now? Went on with those sugestions or tried the ini's route?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Well i got the non array add version working good but im having issues with ArrayAdd as it doesnt seem to work like the helpfile implies

example below using just CCleaner as a reg key to search for

For $regloop = 1 To $aRegPath[0]
        For $keyloop = 1 To $aRegKeys[0]
;~ =================================================
            Local $aUninstallList = '' ; Tried this as well to give it an array head start  >>> [2] = ["Org Item 1", "Org item 1"]
;~ =================================================
            If _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") ; Find UninstallString
                _ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite(@error & @CRLF)
                ConsoleWrite($sUninstallPath & ' Q' & @CRLF)

            ElseIf _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") ; Find UninstallString
                _ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite(@error & @CRLF)
                ConsoleWrite($sUninstallPath & ' U' & @CRLF)

            EndIf
        Next
    Next

    _ArrayDisplay( $aUninstallList)

The return i get is

 

0

"C:Program FilesCCleaneruninst.exe" 

 

Which doesnt exist in the ArrayAdd returns, im confused

Anyway after this gets working im gonna do an arrayUnique to remove the extras and send it to the uninstallers

Edited by Chimaera
Link to comment
Share on other sites

@error that is zero doesn't need to be documented as it implies there was no error. Maybe check the return value of the function instead.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Wait wait i wasnt check the actual addarray...

Local $aUninstallList [2] = ["Org Item 1", "Org item 1"]
;~ =================================================
            If _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") ; Find UninstallString
                Local $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite($test & '|' & @error & @CRLF)
                ConsoleWrite($sUninstallPath & ' Q' & @CRLF)
            ElseIf _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") ; Find UninstallString
                $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite($test & '|' & @error & @CRLF)
                ConsoleWrite($sUninstallPath & ' U' & @CRLF)
            EndIf

which gives

2|0
"C:Program FilesCCleaneruninst.exe" 
 
Or
Local $aUninstallList = '' ;[2] = ["Org Item 1", "Org item 1"]
;~ =================================================
            If _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") ; Find UninstallString
                Local $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite($test & '|' & @error & @CRLF)
                ConsoleWrite($sUninstallPath & ' Q' & @CRLF)
            ElseIf _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") ; Find UninstallString
                $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite($test & '|' & @error & @CRLF)
                ConsoleWrite($sUninstallPath & ' U' & @CRLF)
            EndIf
-1|1
"C:Program FilesCCleaneruninst.exe" 
 
Does an array have to be created with data?, but then the top example has data but is not a 1 or 2d array
Link to comment
Share on other sites

You have to provide an array, so Local $aArray[0] is the minimum you can provide. Plus if you read the help file you will notice @error 1 is the variable is not an array, so that should answer your question.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I didnt even know you could open an array like that  Local $aArray[0]

Local $aUninstallList[0] ; Inialize array with no elements
;~          _ArrayDisplay( $aUninstallList)
;~ =================================================
            If _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "QuietUninstallString") ; Find UninstallString
                ConsoleWrite($sUninstallPath & ' Q' & @CRLF)
                Local $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite('$test = ' & $test & ' | error = ' & @error & @CRLF)

            ElseIf _IsRegistryExist($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") Then
                $sUninstallPath = RegRead($aRegPath[$regloop] & $aRegKeys[$keyloop], "UninstallString") ; Find UninstallString
                ConsoleWrite($sUninstallPath & ' U' & @CRLF)
                $test =_ArrayAdd( $aUninstallList, $sUninstallPath)
                ConsoleWrite('$test = ' & $test & ' | error = ' & @error & @CRLF)
            EndIf
        Next
    Next

    _ArrayDisplay( $aUninstallList)

Now im getting this

 

"C:Program FilesCCleaneruninst.exe" U

$test = 0 | error = 0

So no errors it seems but it still doesnt add the "C:Program FilesCCleaneruninst.exe" into the array..

Ill keep looking

Link to comment
Share on other sites

Well it works for me...

 

#include <Array.au3>

Local $aUninstallList[0], _
        $sUninstallPath = '"C:\Program Files\CCleaner\uninst.exe" U'
_ArrayAdd($aUninstallList, $sUninstallPath)
_ArrayDisplay($aUninstallList)
I hate to be critical, but in future could you post something that I could use as I notice you tend to strip sections from your code expecting people to understand what is going on. BUT here is a solution, move that array declaration outside of the loop.

 

I have said it many times on the forum, don't declare variables inside loops, as it slows down performance and leads to issues such as this.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

#include <Array.au3>

; You find it in the loop.
Local $aUninstallList[0], _
        $sUninstallPath = '"C:\Program Files\CCleaner\uninst.exe" U'
_ArrayAdd($aUninstallList, $sUninstallPath)

Local $aUninstallList[0] ; But then you re-declare again. Which will clear the previous contents added.
_ArrayDisplay($aUninstallList)

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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