by Agent 47 (1 Submission)
Category: Encryption
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 26th November 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Autoplay Remover
API Declarations
'this code can remove the autoplay bug which usually appears after right clicking on any external storage device(flash drive). if u have any suggestions or any problems u can contact [email protected].
Private Sub cmderase_Click()
Dim virpath
'show all the hidden files and system hidden files
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"), (1), "REG_DWORD"
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"), (1), "REG_DWORD"
'select the path
virpath = Left(drv1.Drive, 2)
On Error GoTo Errorhandler
Errorhandler:
If Err.Number = 53 Then
'if the file does not exist or cannot be deleted then do following:
MsgBox "Cannot Find Any Infected Files. If the Problem Still Exists, Please use some other Anti-Virus.", vbCritical, "File Not Found"
'hide all the files along with the system hidden files
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"), (2), "REG_DWORD"
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"), (0), "REG_DWORD"
Else
'if the file is found then do the following:
SetAttr (virpath & "\autorun.inf"), vbNormal
Kill (virpath & "\autorun.inf")
MsgBox "Infected Files have been Removed, Please Safely Remove the Flash Drive and Plug it in Again. This Program will now close automatically.", vbInformation, "Removed"
'hide all the files along with the system hidden files
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"), (2), "REG_DWORD"
WshShell.RegWrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"), (0), "REG_DWORD"
End
End If
End Sub