Sunday, August 14, 2005

HOW TO DELETE STUBBORN FILES?

First, a brief explanation on why this happens. This is usually because an active process has an open handle to the file which prevents it from being deleted. Normally if you close down all running programs you'll find that most files will then be free to delete, but that's not always the case, and in some cases it may even be a trojan that's preventing itself from being deleted.

BASIC REGISTRY RULE: Any changes made to the registry file are crucial to the running of Windows and if damaged or misconfigured, could cause severe problems.
Follow Microsfot's recommended instructions to "BackUP" all important data first. It's recommended to save the backup on a CD, DVD or seperate HD due to the size factor (large)

http://search.microsoft.com/search/results.aspx?st=b&na=88&View=en-us&qu=backup

This option is not installed in Windows XP Home Edition. To install you will need the XP Home CDRom. Navigate to %CDROM%\VALUEADD\MSFT\NTBACKUP\. Look for Ntbackup.msi and double-click it to execute the install wizard.

1.) MoveFileEx - A Windows function that moves an existing file or directory

WARNING: editing the registry can be dangerous if you don't know what you're doing, make sure to USE YOUR HEAD, if you removed something you didn't want to, don't worry, just use the back up in this program

a.)The MOVEFILE_DELAY_UNTIL_REBOOT option places an entry under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations and the file is moved or deleted (if destination NULL) when the system next reboots. Unfortunately as this is not supported under Windows95/98 an application must use entries in WININIT.ini to achieve the same effect.

b.)BOOL MoveFileEx (LPCTSTR pExistingFilePath, LPCTSTR pNewFilePath, DWORD dwFlags)

* TRUE if function succeeded

pExistingFilePath.......Source path to an existing file
pNewFilePath............New location for the file
dwFlags....................Optoions controlling the move
* Move or rename a file

Move or rename a file to a new location.
Only meaningfully implemented on NT. Windows95 returns
ERROR_CALL_NOT_IMPLEMENTED, use MoveFile instead.
The source and destination path should be on the same drive as the system can then just change folder entries without actually copying the file contents. If MOVEFILE_COPY_ALLOWED is supplied and the system needs to copy the file it will require the additional disk space for the temporary file, in this case the original file is deleted only after the copy is successful.

c.)The flags allow more control over the move, it can be zero or a combination of the following values :
MOVEFILE_REPLACE_EXISTING.......The destination can be overwritten if it exists
MOVEFILE_COPY_ALLOWED.............Allow a copy if destination on a different drive to the source
MOVEFILE_DELAY_UNTIL_REBOOT...The move takes place on reboot (NT only)
MOVEFILE_WRITE_THROUGH...........Do not return until changes flushed to disk (NT only)

OR

2.)Using Windows InProcServer32 process

WARNING: editing the registry can be dangerous if you don't know what you're doing, make sure to USE YOUR HEAD, if you removed something you didn't want to, don't worry, just use the back up in this program

a.)Open notepad, copy and paste the code below. Then save the file as "avifix.inf" without the quotes
; Windows XP explorer movie fix.
;
; WARNING - Use this file at your own risk.
;
; Executing this file will remove a registry key which makes explorer load shmedia.dll.
; Simply put, this removes the annoying "permission denied" errors when trying to
; move/copy/delete AVI files.
;
; To use this fix, right-click on the file and select install. Done.
;
; Information about the registry key from multiple sources.
; Inf-file compiled by Moo (2002-03-22).
; Idea by Duxus. Thanks to the kind people of "[BBB] Sweden #01", you know who you are!
;

[version]
signature="$Windows NT$"

[DefaultInstall]
DelReg = Reduce.Reg

[Reduce.Reg]
HKLM, "SOFTWARE\Classes\CLSID\{87D62D94-71B3-4b9a-9489-5FE6850DC73E}\InProcServer32"
2. Right-click "avifix.inf" and select install

OR

3.)Delete the file in DOS mode (99.99% success ratio)

a.)Download & install DOS Here (197kb) - "An Explorer Shell Extension to provide easy and quick access to the DOS Prompt in the requested folder"
Code:
http://user.tninet.se/~fgo483j/files/ch20.zip

b.)Open Explorer and go to the directory where the stubborn file resides (DO NOT HIGHLIGHT THE FILE)

c.) Right Click and select "CMD here"

d.)Close all open applications

e.)Open the Task Manager and click on the Processes tab, select "explorer.exe" under Image Name, click "End Process"

f.)You will only have the command prompt and the task manager open

g.)In the Command Prompt, DEL the offending files (DEL *.mpg, DEL mus*.avi, DEL test.wmv, etc.)

h.)The files should now delete without a problem. Now go back to the task manager and click on the Applications tab. Click the "New Task..." button. in the dialog, type explorer.exe and click OK

OR

4.)Delete the file association first

WARNING: editing the registry can be dangerous if you don't know what you're doing, make sure to USE YOUR HEAD, if you removed something you didn't want to, don't worry, just use the back up in this program

a.)Start >Run >regedit {enter}

b.)Navigate to this key HKEY_CLASSES_ROOT\SystemFileAssociations\.avi\shellex\PropertyHandler

c.)Delete the "Default" key

d.)Close regedit

e.)Follow the above test again, is a simple del doesn't work

AND

5.) Delete the file in DOS mode

a.)Start >Run >cmd {enter}

b.)Navigate to the folder the file is in, i.e. if its in c:\folder\anotherfolder\file, type "cd c:\folder\anotherfolder" {enter} The coomand prompt should change to let you know you are in the correct directory.

c.)Type "dir /x" {enter}

d.)The offending file will be listed like (filena~1.xxx)

e.)Type attrib -r -s -a -h filename.extension {enter}

f.)Take note of the name and type "del filena~1.xxx" {enter}

OR

6.)Try to take ownership of the file

a.)Right click the file
b.)Select the security Tab
c.)Select properties
d.)Select Advanced
e.)Select Owner
f.)Find the User or group you wish to give ownership to and select it
g.)Click apply
h.)now try deleting it.

OR

7.) If the file is Media (MP3, MPG, AVI, etc...)

a.)Remember the filename (X) and location
b.)Run another file (Y) with the same extension
c.)now Delete the file (X)

This occurs sometimes when windows thinks that the file (X) ur trying to delete is still open, eventhough u closed the app and the file.

OR

8.)Try one of these small programs

a.)FreeFile - "FreeFile will free a file by finding the process that holds the lock, and allow you to terminate it"
Code:
http://www.skrubbeltrang.com/Tools.aspx?Tool=FreeFile

b.)ZAP - "deletes files that are either in use or otherwise cannot be deleted" (works with XP & 2K)
Code:
http://helpdesk.kixtart.org/Download/Utils/zap.exe

c.)DELLATER (3kb) - "DelLater is the ideal program to use when you can't delete a file, no matter how hard you try" - This tool does the same as above in Option 1
Code:
http://www.diamondcs.com.au/downloads/dellater.zip

d.)DeepDelete (15kb) - "DeepDelete is a file shredder designed to totally delete files on your hard drive. It works by overwriting files many times before deleting them, making them almost impossible to recover. DeepDelete uses a standard of stredding that is more powerful than the official US DoD standards." - This tool is no longer updated/developed
Code:
http://www.methlabs.org/deepdelete_r3.zip

RESULTS WILL VARY
No matter how good your systems may be, they're only as effective as what you put into them.

0 Comments:

Post a Comment

<< Home

eXTReMe Tracker