Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to eyeball08,Wondergirly,bofh,johnstevens77,Bhoddhisatva, for Donating to support the site

Windows 11 - How do I delete this file?

Seek assistance with all types of tech. - computer, phone, TV, heating controls etc.
Julian
Lemon Quarter
Posts: 1389
Joined: November 4th, 2016, 9:58 am
Has thanked: 534 times
Been thanked: 677 times

Windows 11 - How do I delete this file?

#500977

Postby Julian » May 17th, 2022, 1:54 pm

I have been trying to solve a mystery where my backup software is in theory set to backup everything on my D: drive yet in some cases it shows fewer files in the backup vs the number of files on my D: drive. I have now discovered at least one culprit and it's interesting and frustrating.

I compared the contents of an aberrant folder in the backup with the contents of its source folder on my D: drive with Windows explorer set to show hidden files as well as regular files and everything seemed to match except the file counts still said there was 1 more file in the D: drive folder vs the backup file count. I then opened a command window on the folder on my D: drive and did a "Dir /A" and voila, there was an additional file called "~$Online Accounts.xlsx" that Windows File Explorer won't show even with the view-hidden-items option set. Since there is also a file called "Online Accounts.xlxs" in that folder this extra file is clearly an auto-saved recovery file left over from an Excel crash (on the 12th August 2015!) so I want to delete it but I can't find a way to do it. I've tried - del ".\~$Online Accounts.xlsx" - but I just get the error message "Could not find D:\Documents\Computer\~$Online Accounts.xlsx".

Does anyone have any ideas? I suppose the nuclear option would be to copy the whole D:\Computer folder plus all of its sub-folders to another location, delete the original copy from the D: drive, then create a new folder on the D: drive called "Computer" and manually copy the individual files and folders back into that newly created folder on the D: drive. That should avoid this wretched ~$ file getting dragged back into the folder but I would prefer to find a more targeted way to delete this type of file since I have file count discrepancies in quite a few other places in my file system so my nuclear option might end up being quite a lot of work.

Edit: I did also try to open the original "Online Accounts" spreadsheet in Excel to see if it would detect the recovery file and offer me the option to restore-from or discard that recovery file but the latest version of Excel that I'm using didn't seem to detect the recovery file at all. I also tried modifying and re-saving the spreadsheet to see if that would cause Excel to delete the ~$ file but again no luck, the wretched thing is still there.

Another edit. The ~$ file is probably not a valid recovery file unless Excel saves recovery files as deltas vs the original which I don't think it does because the original spreadsheet has a file size of 55,161 bytes as reported by DIR whereas the ~$ file has a reported file size of 165 bytes.

- Julian

Breelander
Lemon Quarter
Posts: 4179
Joined: November 4th, 2016, 9:42 pm
Has thanked: 1001 times
Been thanked: 1855 times

Re: Windows 11 - How do I delete this file?

#500982

Postby Breelander » May 17th, 2022, 2:14 pm

Julian wrote:.... I want to delete it but I can't find a way to do it. I've tried - del ".\~$Online Accounts.xlsx" - but I just get the error message "Could not find D:\Documents\Computer\~$Online Accounts.xlsx"

That may be because it is a hidden file. First use the command:
ATTRIB -H "~$Online Accounts.xlsx"
then try the del command again.

Breelander
Lemon Quarter
Posts: 4179
Joined: November 4th, 2016, 9:42 pm
Has thanked: 1001 times
Been thanked: 1855 times

Re: Windows 11 - How do I delete this file?

#500986

Postby Breelander » May 17th, 2022, 2:25 pm

Julian wrote:Another edit. The ~$ file is probably not a valid recovery file unless Excel saves recovery files as deltas vs the original which I don't think it does because the original spreadsheet has a file size of 55,161 bytes as reported by DIR whereas the ~$ file has a reported file size of 165 bytes.

No, it isn't. An Ofice file starting with "~$" is an 'Owner File'. Here's a description of Word doing the same thing.

Microsoft wrote:Owner File (Same Directory as Source File)

When a previously saved file is opened for editing, for printing, or for review, Word creates a temporary file that has a .doc file name extension. This file name extension begins with a tilde (~) that is followed by a dollar sign ($) that is followed by the remainder of the original file name. This temporary file holds the logon name of person who opens the file. This temporary file is called the "owner file."
https://support.microsoft.com/en-us/top ... a367cc4c85

GrahamPlatt
Lemon Quarter
Posts: 2077
Joined: November 4th, 2016, 9:40 am
Has thanked: 1039 times
Been thanked: 840 times

Re: Windows 11 - How do I delete this file?

#501019

Postby GrahamPlatt » May 17th, 2022, 4:40 pm


Julian
Lemon Quarter
Posts: 1389
Joined: November 4th, 2016, 9:58 am
Has thanked: 534 times
Been thanked: 677 times

Re: Windows 11 - How do I delete this file?

#501057

Postby Julian » May 17th, 2022, 7:22 pm

Thanks so much everyone. You guys are great.

I tried the solutions in order & didn't need to go past the first suggestion from Breelander. Removing the Hidden attribute at the command line immediately made the offending ~$ file appear in the Windows Explorer window I also had open for that folder so I then simply right-clicked on the then-visible ~$ file and deleted it as I would any other file.

Now I need to go and hunt down and hopefully reconcile all of these other file-count anomalies. Tedious but at least I have another tool in my toolkit now (knowing how to delete files like this) to help me. And I've also learned what an "Owner file" is so not an entirely wasted half hour or so.

- Julian


Return to “Technology - Computers, TV, Phones etc.”

Who is online

Users browsing this forum: bluedonkey and 27 guests