Jump to content

Remove directory with unknown/random name


am632
 Share

Recommended Posts

Hi,

Im wanting to make a tool that removes a specific scarware application but im stuck and dont know how to continue, i think a search should go in here somewhere but i dont know how to do that. This is what i am trying to automate... http://www.2-spyware.com/remove-security-suite.html

Here is a snippet of the code im using.

If FileExists(@UserProfileDir & "\Local Settings\Application Data" & "\*\*shdw.exe") Then
    DirRemove(@UserProfileDir & "\Local Settings\Application Data" & "\*\*shdw.exe", 1)
EndIf

also, how would i go about removing a registry key with the same filename which was random such as "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run "[random]"

Thanks

Link to comment
Share on other sites

ok, I've looked at the FileFindFirstFile and have come up with this....

;search for security suite exe
$search = FileFindFirstFile(@UserProfileDir & "\Local Settings\Application Data\*\*shdw.exe")

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "Security Suite was not found on the system")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search)
    If @error Then ExitLoop

    MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)

when ever i run the program I get the "error - security suite was not found on the system" even if i have a folder named 'ramdomblabla' in the local settings\application data folder with an exe named blashdw.exe?

any ideas?

thanks

Link to comment
Share on other sites

Try _FileListToArray? ;)

Thanks for this. I've had a quick look at this but im not sure how to use this for my problem with the folder and file name being random. could you possibly elaborate please?

thanks for the help guys

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...