Using Windows Explorer, how to find file names starting with a dot (period), in 7 or Vista?

41,068

Solution 1

Use Window's "Search Advanced Query Syntax", which basically lets you do stuff that Vista and XP advanced search used to let you (that Windows 7 hid). Read about it on MSDN.

Hence, you can just search filename:. to find all files with a file name that begins with "."

Solution 2

The windows Command prompt method to find all "dot files" in all directories below the current directory, but excluding directory names beginning with dot:

dir .*.* /s /a-D

Solution 3

filename:.*. -kind:folder

This finds all files which begin with a period, even those which do not have an extension. -kind:folder excludes folders from the search. Tested on Windows 7. Should work on Vista and Windows 8.

Solution 4

You can stop the Mac creating the .DS_Store files with this command in Terminal:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Then log out and in again (or reboot). That should fix it. As for the other files, this is a well-known problem and I haven't been able to find a quick answer.

Solution 5

Late addition ... I'm adding this as it comes in quite handy to set attributes from the command line for dot files (or directories) ...

The first dot is to search the current directory; the second is 'back-slashed escaped' to search for names starting with a dot literal.

dir ".\.*" /A 
Share:
41,068

Related videos on Youtube

Chris W. Rea
Author by

Chris W. Rea

Husband, dad, computer geek, independent software developer, Canadian. Likes: helping people, software and technology, personal finance, consumer protection, law, personal productivity, books, music. Within personal finance, specific interests include retirement planning, taxes, investing, self-employment. Dislikes: Conflict of interest. I founded the Personal Finance & Money Stack Exchange and was a moderator on the site during its formative years. Twitter: @cwrea    LinkedIn: in/chriswrea    GitHub: @cwrea

Updated on September 17, 2022

Comments

  • Chris W. Rea
    Chris W. Rea over 1 year

    I've got a MacBook laptop in the house, and when Mac OS X copies files over the network, it often brings along hidden "dot-files" with it. For instance, if I copy "SomeUtility.zip", there will also be copied a hidden ".SomeUtility.zip" file. I consider these OS X dot-files as useless turds of data as far as the rest of my network is concerned, and don't want to leave them on my Windows file server.

    Let's assume these dot-files will continue to happen. i.e. Think of the issue of getting OS X to stop creating those files, in the first place, to be another question altogether.

    Rather: How can I use Windows Explorer to find files that begin with a dot / period? I'd like to periodically search my file server and blow them away. I tried searching for files matching ".*" but that yielded – and not unexpectedly – all files and folders.

    Is there a way to enter more specific search criteria when searching in Windows Explorer? I'm referring to the search box that appears in the upper-right corner of an Explorer window. Please tell me there is a way to escape my query to do what I want?

    (Failing that, I know I can map a drive letter and drop into a cygwin prompt and use the UNIX 'find' command, but I'd prefer a shiny easy way.)

    • quack quixote
      quack quixote about 14 years
      i thought cygwin was the shiny easy way! :)
  • raven
    raven about 14 years
    dir \.* only returns .rnd (what this is, I don't know). If you want to see the files that start with a ., you need to use dir .*.*.
  • Chris W. Rea
    Chris W. Rea about 14 years
    Thanks for the suggestion, but I just tried this and it also seems to return all files and folders in Windows 7, not just those beginning with a period.
  • Mike
    Mike about 14 years
    To clarify - the /s searches all subdirectories, but the /a-D excludes directory names beginning with dot. I'll edit the answer to make it clearer.
  • Gaff
    Gaff over 12 years
    Your image is broken. Do you happen to have the original that you could reupload? Thanks.
  • Rexi
    Rexi over 12 years
    thanks, I have an icon library from all the free downloads i encounter. Have just deleted 25k files starting with .
  • Peter Mortensen
    Peter Mortensen about 12 years
    The link seems to be (effectively) broken (it redirects to windows.microsoft.com/en-US/windows/downloads/windows-xp).
  • user3333603
    user3333603 about 12 years
    @PeterMortensen fixed!
  • Evelina
    Evelina almost 9 years
    Great suggestion, just used this to find files matching ".-" without needing to use a regex. Also once files are found you can do the normal right-click operations e.g. delete.
  • Itsme2003
    Itsme2003 over 5 years
    The back slash is not a 'back-slashed escape' character. Rather it is a path separator which separates the first period, which is the path, from the second period, which is the initial part of the file name.