Windows 7 Can not delete file

eldiener

Honorable Member
Joined
Nov 17, 2012
I have a file in a directory called "footer." This file was evidently created by some software I have. All my attempts to delete this file come back with:

"Could Not Find some_long_path\footer."

Yet the file shows both in Explorer and when I type "dir" from a command window. In Explorer the size says 61 kb, but when I click on the Properties the size says 0 bytes. I cannot change the name of this file either. I have also tried to take ownership of this file but to no avail.

Any ideas for deleting this file would be welcome.
 
You need to take ownership, then grant yourself full access. Then you should be able to delete.
 
When I click on the Properties for the file, and then the Security tab, it says:

"The requested security information is either unavailable or can't be displayed."
 
You probably don't have access to few the permissions. If UAC is enabled and your user is an administrator there should be a button with the UAC shield to allow you to view the permissions. Alternately you can open an elevated command prompt, CD to the directory with the file and take ownership with takeown /f <filename> then give yourself permissions with cacls /e <filename /g username:F
 
When I try, from the directory in which the file exists:

takeown -f footer.

I receive the reply:

ERROR: The system cannot find the file specified.

Yet when I try:

dir

I receive the output:

Volume in drive C is MYDRIVE
Volume Serial Number is 1E72-AA80

Directory of some_long_path

01/23/2017 09:11 PM <DIR> .
01/23/2017 09:11 PM <DIR> ..
12/10/2016 03:28 PM 61,825 footer.
1 File(s) 61,825 bytes
2 Dir(s) 163,949,559,808 bytes free
 
Try putting single quotes around the filename or type part of the file and tab complete it.
 
This file could have been put there by one of your programs. Have you tried using the SYSTEM RESTORE built into Win7? Attempt to "rollback" your system back to a point in time PRIOR TO THAT FILE SHOWING UP IN YOUR C: DIRECTORY.

Before attempting this however, I would make certain that you Make sure to BACKUP ALL PERSONAL DATA FROM THIS COMPUTER PRIOR TO ATTEMPTING FURTHER HARDWARE TESTING OR SOFTWARE REPAIRS IN ORDER TO AVOID IRRETRIEVABLE DATA LOSS!!!

It's very important you have your data backed up, since if this rogue file is being produced by a virus/malware on your computer, some viruses can cause SYSTEM RESTORE to fail, or worse they can scramble your Windows, and catastrophic file loss can occur.:waah: Also, your Windows might not boot after this attempt! :waah:

This method is kind of like using a Big Hammer to drive a little nail; but if often fixes things that wind up in your computer that you SWEAR you didn't put there or even click on. This is quite likely to get rid of your bad file, with the least amount of effort.:up:

If the problem persists after the Restore, another thing you can try that requires a bit more work, would be to run the MSCONFIG.EXE program from the <Windows-logo-key+R> command, and simply type in the command "MSCONFIG.EXE" into the Run box that comes up. This will take you to the SYSTEM CONFIGURATION program, click on the STARTUP TAB, and under Startup, make sure all your items are have checks in the little checkboxes, then find and click on the DISABLE ALL button. This will disable all programs that run when your computer starts up; if there is an offending program that's putting that file into your C: root directory, after reboot it should be gone!! :ohyea:

If the problem STILL persists, another way to see what's going on is to re-use the method above using the MSCONFIG.EXE program, but this time click on the BOOT TAB, and go into BOOT OPTIONS section on the bottom half of that main page; look for the SAFE BOOT radio button and click it, then find the sub-radio button underneath that says NETWORK and click that button as well. Click OK and Win7 will tell you that you need to restart your computer in order for these changes to take effect; do so. Your computer will reboot; if you have a password on your Win7 Admin login account, it will ask you for that password before it will let you into Safe Mode and your Windows desktop. Once you get your password typed in and you are on your Win7 desktop; wait a few moments and your desktop should be up. Note that the screen resolution will be diminished and things will look grainy as Safe Mode loads the very basic video mode of lowest resolution (for troubleshooting purposes only); you can then fire up Windows Explorer and look at your C: drive and see if your bad file is gone; if so something else in your Windows is putting that file there (not any of your Startup programs however!) and you'll need to look at repairing your Win7 itself or doing a Win7 Reset or Reinstallation from Factory Media (if you have it).

At this point, you will need to decide what to do. If that file is still there, my guess is that it's virus/malware related and you need to clean ALL viruses from your computer. While you are still in SAFE MODE, you should then visit the TrendMicro.com website and run their free online scanner called HOUSECALL to scan your computer for viruses. Remove all viruses found after the scan. Next, visit the free MALWAREBYTES antispyware website at malwarebytes.org, install MALWAREBYTES and scan/remove all spyware viruses found. Finally, re-enter the SYSTEM CONFIGURATION program using the method above (MSCONFIG.EXE), return to the BOOT TAB, and go into BOOT OPTIONS section on the bottom half of that main page; look for the SAFE BOOT radio button and click it again to turn the Safe Boot option off completely. Click OK, and your computer will ask you to restart your computer again to save those changes. This will effectively put your computer back into NORMAL mode; which is what you want.

After your computer restarts, check your C: drive directory again. If the bad file is gone, you had a virus/spyware virus/malware of some kind and you are good to go! :applaud:

If none of these repairs work, you probably have severe Windows corruption in your registry that is not repairable except by expert Computer Techs (expensive) at a repair shop; or you simply could have a new virus/malware out that currently does not have any antidotes available for cleaning.:headache: If this is the case, your only recourse is to backup all your stuff as mentioned above, and perform a Win7 Reset or a Win7 Factory Reinstallation from Factory Media (if you have it). If you have to do a Factory Reinstallation and you don't have the Media, you can often purchase it by calling your computer manufacturer and they will send it to you in the Mail for $29-$99 US (USB or DVD) if it's available. If your computer is too old (say older than 2007); your Recovery Media for your model PC or laptop may no longer be available if it's over 10 years old, and you are probably out of luck :waah:unless you can find someone like me who can rebuild your machine from scratch manually.:scratch: Not many Techs know how to do this anymore; and fewer will want to do it because of the labor time (60-100 hrs.).:skull:

You now have all the options you need to get this going; and we've still ignored testing your Hard Drive and RAM memory Sticks; if you are the DIY type, here's the link to do that too: Windows 10 - Unclickable Task Bar

Best of luck to you, and remember to print out all of these instructions on your printer so you have hardcopy in case you scramble your machine! And if you get stuck, ask questions by posting back to this thread. We are here 24x7x365.

<<<<<BIGBEARJEDI>>>>> :) :stars:
 
Last edited:
Putting single quotes around the file
I have a file in a directory called "footer." This file was evidently created by some software I have. All my attempts to delete this file come back with:

"Could Not Find some_long_path\footer."

Yet the file shows both in Explorer and when I type "dir" from a command window. In Explorer the size says 61 kb, but when I click on the Properties the size says 0 bytes. I cannot change the name of this file either. I have also tried to take ownership of this file but to no avail.

Any ideas for deleting this file would be welcome.

After doing dir /x I was able to use the short name to delete the file successfully.
 
Great! Glad you got it fixed.:up: Thanks for sharing your solution with us.:D

Just a note, and you may have already done this; but did you Power off your computer, and Power back on and see if the file remained deleted?? If it didn't you may not have permanently eliminated the file from showing up on your computer and you may then need to use one or more aggressive repairs I mention in POST #7 above. Let's hope not!

Cheers!
<<<BBJ>>>
 
I apologise for hijacking this post. I am now able to start a new thread, and have done so.
 
Last edited:
I don't think the file is locked. I mentioned the first time (when I hijacked the thread) that I renamed the file (it was misspelled when I downloaded it), then tried to cut and paste it to another folder. Then it tells me that the file cannot be found. It requests me to find the find first, so I do a search, but it doesn't exist (though an icon still remains in my "incoming" folder). Searching for both the original file name (with the misspelling) and the renamed file in both the "incoming" folder and the folder I moved it to is not successful. It refuses to delete the icon as it doesn't exist apparently.
 
Back
Top Bottom