Sign in to follow this  
Followers 0
Draygoes

Please help me with a cleaning script.

4 posts in this topic

Ok, so I have written a cleaning script. Right now, it is simply a test.

Heres what it found:

C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_infolet_link.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_infolet_survey.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_moreinfo.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_noitems.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_senddata.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_statinfo.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_survey.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_tw.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\Channels\ch_u6\HTML\localization\lang_wait.xml
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\AUAgent.exc
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\AUCommon.cfg
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\DB
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\DSAgnt.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\DSAgnt_2.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\DSAgnt_GTActions.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\DSBrws.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\gdql_d_DSAgnt.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\glog.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\qdiagd_DSAgnt.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\qdiagd_DSBrws.log
C:\Users\Draygoes\AppData\Roaming\GTek\GTUpdate\AUpdate\DellSupport\Settings.log
C:\Users\Draygoes\AppData\Roaming\gtk-2.0\gtkfilechooser.ini
C:\Users\Draygoes\AppData\Roaming\Identities\{D25FE946-C837-47EF-BE72-70A30EF67D12}
C:\Users\Draygoes\AppData\Roaming\ImageBadger\config.ini
C:\Users\Draygoes\AppData\Roaming\IndigoRose\AutoPlay Media Studio
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner
C:\Users\Draygoes\AppData\Roaming\IObit\FirefoxTCP
C:\Users\Draygoes\AppData\Roaming\IObit\SmartRAM
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\AutoShutDown.ini
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup.ini
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Ignore.ini
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Main.ini
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\bdvsjb.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\ghqbch.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\iuaizx.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\ixqoto.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\pothkg.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\Registry
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\uknmoq.reg
C:\Users\Draygoes\AppData\Roaming\IObit\Advanced WindowsCare\Backup\zhdixn.reg
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Animation Showcase.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\backup.dat
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\BIT4FAE.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\bookmarks.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Camera.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\CFG1C68.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\CFG2CBD.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\CFGC2C4.tmp

C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\CFGF26C.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\COMPONENTS.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\ConcentrationScoresAndSettings.xml.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Dark Dungeon.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Dark Invaders.sln.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Dark Invaders.suo.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Dark Invaders.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Example 1.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\FX.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\G2A_100000001207789083_A799C12B-0C77-45e6-B601-4B6D722A016B.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Goo63F4.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\gtn5FFC.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Image showcase.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\iti5F19.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Light.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\lock.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\LType.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Matrix.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\MinesweeperSettings.xml.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\MSIAC8B.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\myplaces.kml.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\OPA12.BAK
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Particle.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\pm3344.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\pm425F.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\pm8A11.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\pmA237.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\pmFE4.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\PurbleShopScoresAndSettings.xml.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\res6386.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Road Terrain.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Samples.sln.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Samples.suo.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\sdi.lg.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\sessionstore.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\SOFTWARE.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Sphere Mapping.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Sprite Showcase.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\swg5B69.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\SYSTEM.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC50A.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC54A.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC55A.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC57B.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC59B.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\TBDC5AB.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Terrain.vcproj.8.00.old
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\Thumbs.db
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\tmp422E.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\UsrClass.dat.bak
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\volume.xml~
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\vs1F69.tmp
C:\Users\Draygoes\AppData\Roaming\IObit\DiskCleaner\backup\vsA8E1.tmpoÝ÷ Øù^jǧ¢ØzØZ¶Ê&zíçâç±µéí춭ج$x¢¸§r[z· u«b&§vaz»-«Hv'g¶)Üç^{ayø¥zÞÆק¶*'²ØZ¶+gyçl¶h¢Gè­«0zYZ±ø¥zÌ"¶N{^ب«Z]÷ß}÷ßqÞ­ë-ë®*mjëh×6#include<File.au3>
#include <GUIConstants.au3>
Global $filelines 
Global  $exttocheck 
Global $location
Global $location2
Global  $i = 0
Global  $e = 0
Global $linesinfile = _FileCountLines( @ScriptDir & "\junkfileexts.txt" )

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Indexer", 706, 200, 193, 125)

GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("File being tested:", 4, 3, 117, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("", 129, 4, 1000, 50)
GUICtrlSetColor(-1, 0x00FF00)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


MsgBox( 0, "Indexing your harddrive...", "Indexing your harddrive...")
listcontents(@HomeDrive, @ScriptDir & "\drivefiles.txt");Index the harddrive
MsgBox( 0, "Done...", "Done. Closing.")




Func listcontents($path,$destfile)
;author: Koshy John---Modified into a cleaning script by Draygoes.
;lists the contents of the given path into the specified destination file
;
;Parameters:
;  $path = a complete path without trailing backslash
;  $destfile = file to which the data is to be written
;Return Value: 0 - failure
;              1 - success
;     @error = 1 - invalid path
;              2 - unable to open destination file


   
    Local $pid
    Local $file
    Local $buffer
    If FileExists($path) = 0 Then
        SetError(1)
        Return 0
    EndIf
    $file = FileOpen($destfile, 2)
    If $file = -1 Then
        SetError(2)
        Return 0
    EndIf
    $pid = Run(@ComSpec &' /C dir/a/b/s "'&$path&'\*"', "", @SW_HIDE, 6)
    While 1
        $buffer = StdoutRead($pid)
        If @error Then ExitLoop
        GUICtrlSetData( $label2, $buffer )
        testfile( $buffer )
        
        
    Wend
    While 1
        $buffer = StderrRead($pid)
        If @error Then ExitLoop
    WEnd
    FileClose($file)
   
    Return 1
EndFunc


Func testfile($line)
        GUICtrlSetData( $Label2, $line )
        For $e = 1 to $linesinfile step 1
        $exttocheck = FileReadLine( @ScriptDir & "\junkfileexts.txt", $e )
        $last3chars = StringRight( $line, 4)
        
        
        If $last3chars = $exttocheck Then
            FileWriteLine( "junkfilesfound.txt", $line )
        EndIf
    Next
EndFunc

    
Func chkindex($location)
    GUICtrlSetData( $Label1, "File Being Tested:" )
    $filelines = _FileCountLines( $location )
    $exttocheck = _FileCountLines( @ScriptDir & "\junkfileexts.txt" )
    $i = 0
    $e = 0
    For $i = 1 To $filelines Step 1
        $line = FileReadLine( $location, $i )
        GUICtrlSetData( $Label2, $line )
        For $e = 1 to $exttocheck step 1
        $exttocheck = FileReadLine( @ScriptDir & "\junkfileexts.txt", $e )
        $last3chars = StringRegExp( $line, $exttocheck, 0)
        
        If $last3chars = 0 Then
            
        EndIf
    Next
Next
EndFunc

And the file extentions:

::::junkfileexts.txt::::

.tmp
.chk
.OLD
.gid
.fts
.$$$
.---
.??$
.___
._mp
.$db
.db$
.dmp
.prv
.aps
.ilk
.pch
.ftx
.mch
.da0
.nch
.NCH
.ftg

Please help me, I cant use this in my main program. It is severly dangerous!


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites



*Bump*

Sorry, but it wound up in the fourth page, and I still havent gotten any replys. :)


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites

*Bump*

Sorry, but it wound up in the fourth page, and I still havent gotten any replys. :)

I don't understand how it should work. You have

While 1
        $buffer = StdoutRead($pid)
        If @error Then ExitLoop
        GUICtrlSetData( $label2, $buffer )
        testfile( $buffer )
       
       
    Wend

Maybe I don't understand StdoutRead, but I don't see that $buffer will be a complete line. It could be say more than one line. Suppose it's 2 lines, and the second line is a file which matches an extension, then both lines will be written to the results file. Maybe that is the problem.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Ok, I finally fixed it. Thanks for looking into the problem for me. :)


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0