Chimaera Posted September 30, 2011 Author Share Posted September 30, 2011 (edited) I tried the example now ive got back to coding and it doesnt seem to work how i was expecting it. Anyway i have had a rethink in order to simplify this code im going use just the count as the how many was removed and keep the arrays for the logfile of what was actually removed So im here atm Global $Deleted = "", $sRegKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" For $i = 1 To $aRegKeys[0] RegRead($sRegKey, $aRegKeys[$i]) If @error = 0 Then RegDelete($sRegKey, $aRegKeys[$i]) $Deleted &= $aRegKeys[$i] & "|" Sleep(100) EndIf Next $aHKLM_Run_Deleted = StringSplit($Deleted, "|") _ArrayDelete($aHKLM_Run_Deleted, 0) The $aHKLM_Run_Deleted gets _ArrayConcatenate nearer the end of the script when i merge 7 of these together So whats the best way to extract the count of how many out of that to give me a number for the gui? Thanks for any suggestions Chimaera Edited September 30, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2011 Share Posted September 30, 2011 Slow down cowboy, this is the first of this code we have seen in this thread. How about a workable example. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Chimaera Posted September 30, 2011 Author Share Posted September 30, 2011 (edited) lol this is where i went from all the suggestions in this thread and reading the helpfile, gimme a min ill knock summat up Actually czardas was right, thats what you get for putting your code down for a while ive got it showing a number now because i was looking at the wrong bit But ive no doubt i shall be back soon enough Edited September 30, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted September 30, 2011 Share Posted September 30, 2011 (edited) There are often several ways to do things. The choice depends on the situation. This might be what you want, though I'm not entirely sure. It depends on how you write the rest of the code. Global $Deleted = "", $sRegKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" Local $iDeleteCount = 0 ; Increment variable. For $i = 1 To $aRegKeys[0] RegRead($sRegKey, $aRegKeys[$i]) If @error = 0 Then RegDelete($sRegKey, $aRegKeys[$i]) $Deleted &= $aRegKeys[$i] & "|" ;Sleep(100) EndIf Next ; The final delimiter needs removing. $Deleted = StringTrimRight($Deleted, 1) ; You could avoid this by not adding it in the first place. $aHKLM_Run_Deleted = StringSplit($Deleted, "|") $iDeleteCount += $aHKLM_Run_Deleted[0] ; Add the count on each run before deleting element 0. _ArrayDelete($aHKLM_Run_Deleted, 0) What is it you are making BTW? You got me wondering. Edited September 30, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted September 30, 2011 Author Share Posted September 30, 2011 Its an automatic tool for removing things from certain keys on the registry at its simplest If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now