Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help]Delete Copies

[Help]Delete Copies

Posts 1–11 of 11 · Page 1 of 1
HalfBajan
HalfBajan
[Help]Delete Copies
Is there any way to make a program that can delete copies of the same file in a single folder and delete numbers before the file pm me the code if it is possible thanks.
#1 · 15y ago
BO
Born2Amuse
I don't really understand your question. Please explain it with better English. Thank You.
#2 · 15y ago
'Bruno
'Bruno
You want to delete an application file which is running trying to delete itself?

You can't delete something that is in use. And don't ask for code... What about if you try urself first?

If you are actually trying to delete something on the folder, I advice you to have a look on System.IO Library, as i am not spoonfeeding you.
#3 · 15y ago
Jason
Jason
I think he simply wants to delete duplicate files in the same folder. If that's what you're aiming at, do what Brinuz said and consult the System.IO namespace (HINT: to see if the files have identical content, check the bytes)

As for removing a number from the beginning of a file...again the System.IO namespace is your best bet, or perhaps My.Computer.FileSystem, either way all you need to do is grab the current file name, use string manip to make it suit your needs, then rename the file to your new name.
#4 · 15y ago
Blubb1337
Blubb1337
Check in startup if a similar file exists, if so delete it....

Tips:

Application.executeablepath
io.file.delete
io.file.exists
#5 · 15y ago
freedompeace
freedompeace
using FileInfo, get all files in folder. MD5/SHA each file, and compare their hashes. If they are the same, delete on of them.
#6 · 15y ago
SmartAlley
SmartAlley
You can compare 2 files to know if they are identical:

Code:
If Dir(File1) = "" Then Exit Function
If Dir(File2) = "" Then Exit Function

Dim lLen1 As Long, lLen2 As Long
Dim iFileNum1 As Integer
Dim iFileNum2 As Integer
Dim bytArr1() As Byte, bytArr2() As Byte
Dim lCtr As Long, lStart As Long
Dim bAns As Boolean

lLen1 = FileLen(File1)
lLen2 = FileLen(File2)
If lLen1 <> lLen2 Then
    Exit Function
ElseIf StringentCheck = False Then
        AreTheyTheSame = True
        Exit Function
Else
    iFileNum1 = FreeFile
    Open File1 For Binary Access Read As #iFileNum1
    iFileNum2 = FreeFile
    Open File2 For Binary Access Read As #iFileNum2

    'put contents of both into byte Array
    bytArr1() = InputB(LOF(iFileNum1), #iFileNum1)
    bytArr2() = InputB(LOF(iFileNum2), #iFileNum2)
    lLen1 = UBound(bytArr1)
    lStart = LBound(bytArr1)
    
    bAns = True
    For lCtr = lStart To lLen1
        If bytArr1(lCtr) <> bytArr2(lCtr) Then
            bAns = False
            Exit For
        End If
            
    Next
    AreTheyTheSame = bAns
       
End If
 
ErrorHandler:
If iFileNum1 > 0 Then Close #iFileNum1
If iFileNum2 > 0 Then Close #iFileNum2
End Function
If they are, just delete one...
#7 · 15y ago
Jason
Jason
Quote Originally Posted by SmartAlley View Post
You can compare 2 files to know if they are identical:

Code:
If Dir(File1) = "" Then Exit Function
If Dir(File2) = "" Then Exit Function

Dim lLen1 As Long, lLen2 As Long
Dim iFileNum1 As Integer
Dim iFileNum2 As Integer
Dim bytArr1() As Byte, bytArr2() As Byte
Dim lCtr As Long, lStart As Long
Dim bAns As Boolean

lLen1 = FileLen(File1)
lLen2 = FileLen(File2)
If lLen1 <> lLen2 Then
    Exit Function
ElseIf StringentCheck = False Then
        AreTheyTheSame = True
        Exit Function
Else
    iFileNum1 = FreeFile
    Open File1 For Binary Access Read As #iFileNum1
    iFileNum2 = FreeFile
    Open File2 For Binary Access Read As #iFileNum2

    'put contents of both into byte Array
    bytArr1() = InputB(LOF(iFileNum1), #iFileNum1)
    bytArr2() = InputB(LOF(iFileNum2), #iFileNum2)
    lLen1 = UBound(bytArr1)
    lStart = LBound(bytArr1)
    
    bAns = True
    For lCtr = lStart To lLen1
        If bytArr1(lCtr) <> bytArr2(lCtr) Then
            bAns = False
            Exit For
        End If
            
    Next
    AreTheyTheSame = bAns
       
End If
 
ErrorHandler:
If iFileNum1 > 0 Then Close #iFileNum1
If iFileNum2 > 0 Then Close #iFileNum2
End Function
If they are, just delete one...
Wanna give credits for source?

And it needn't be that complex, as freedom said, get the md5 hashes of the two files. If they are the same, delete one.
#8 · 15y ago
SmartAlley
SmartAlley
Quote Originally Posted by Jason View Post


Wanna give credits for source?

And it needn't be that complex, as freedom said, get the md5 hashes of the two files. If they are the same, delete one.
Well, obviously is not mine -_- and I didnt said it was
I didn't released anything, Im not taking credits of this
But also there's no way you can find out if this is mine or not in case
Im a dumbass and say is mine

Credits?
Google who help me to find it...
I wont say website since I wont advertise
#9 · 15y ago
Jason
Jason
Quote Originally Posted by SmartAlley View Post


Well, obviously is not mine -_- and I didnt said it was
I didn't released anything, Im not taking credits of this
But also there's no way you can find out if this is mine or not in case
Im a dumbass and say is mine

Credits?
Google who help me to find it...
I wont say website since I wont advertise
I know it's not yours because you made a thread about a week or two ago saying you wanted to start learning.
#10 · 15y ago
SmartAlley
SmartAlley
Quote Originally Posted by Jason View Post


I know it's not yours because you made a thread about a week or two ago saying you wanted to start learning.
smart boy

Soon I will release something, and I will give credits even if I take some tips of any coder out there
#11 · 15y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Tags for this Thread

None