1

This is my first question here so I'll to try be as clear as I possibly can, but if anything is unclear please give me some feedback!

I am a Mechanical Engineer using the CAD software SolidWorks. I have a problem with some files that show up every now and then. I know that SolidWorks uses temporary files to lock and files and show which user is currently using the file. (~$'filename') These files do not get deleted when SolidWorks crashes, however usually I can either manually delete them or they get written over and deleted the next time 'the owner' opens the file. (See link)

https://www.mlc-cad.com/solidworks-help-center/how-to-tell-who-has-a-solidworks-file-open/

In my case this is not happening with the templates we use for drawings. The weird thing is that these files are not visible to me when looking for them in Explorer or even using the dir command in CMD. Why is it a problem if they do not show in Windows Explorer you ask? Well, they do show up in my pop-up window when creating drawings. And last week I even had some files gaining multiple instances of ~$~$.

I am unable to rename or delete the files using commands like ren or del. Also they do show up when I use the Power Query function of Excel.

As of now I have renamed the folder, created a new folder and manually copied the necessary files. This feels like a terrible solution. Any help would be appreciated.

Screenshot


Edit: I did learn something new, that hidden files don't show up when using dir command. Thanks for that @LPChip. For clarification I have added another picture to show that I did have the show hidden files turned on. After running the following command in my directory and still they didn't show. After changing the attribute hidden off and on they do show up as hidden files. Still remains a mystery to me how or why Windows doesn't show these files in explorer.

screenshot hidden files

I did manage to make a batch file to resolve this!

attrib ~$* -h
del ~$*

Video after it worked!

Thanks for the help!

N Baan
  • 38

1 Answers1

1

Files that start with ~$ are often temporary files. Because they are irrelevant for users to see, they are often created with the hidden attribute set, and as such, you don't see them if you type dir.

If you type dir /ah, which stands for dir, show attribute hidden, you get to see all hidden files, and its likely the file will then show up.

After you confirm that the file is there but hidden, you can now
unhide it by typing attrib filename -h

The command dir will now also show the file, and del and other commands can now be used against this file.

LPChip
  • 66,193