0

One of my clients has saved many emails to Windows folders as text files without file extension, and now wishes to see previews of those files in Windows Explorer. I found a partial answer here to associate files without extensions so they will open with our desired program (notepad): How to set the default program for opening files without an extension in Windows? but those methods don't show the file content in Windows Explorer preview.

Any ideas?

8
  • 2
    How about renaming the files?
    – gronostaj
    Aug 1, 2018 at 14:52
  • They have literally thousands of emails saved this way, so renaming is probably not practical.
    – posix
    Aug 1, 2018 at 14:57
  • That begs the question: why in the world did this end-user save thousands of e-mail messages as plain text files without any extension, rather that utilizing a PST file?
    – Run5k
    Aug 1, 2018 at 15:01
  • To be exact, it is nine different users and they have been doing this since long before I took over their IT support. They are a property management company and they do this so that all emails, documents, photos, scans, etc. for a particular property are all saved in shared folders with the particular property name.
    – posix
    Aug 1, 2018 at 15:25
  • Understood. That being said, your predecessors didn't take the time to teach them how to drag-and-drop individual email messages so that they are saved on the file server in .msg format?
    – Run5k
    Aug 1, 2018 at 15:43

4 Answers 4

2

According to all of above information, I have tested many times. we can rename the files without extension, no matter what other type of files you have in the folder.

  1. Run cmd.exe as administrator.
  2. Type CD C:\folderpath
  3. Type rename *. *.txt instead of * *.txt
  4. Now all the file without extension will become XXX.txt

If all the files has the extension, you will get The syntax of the command is incorrect.

enter image description here

Then you can use preview to see these files.

———————————————————————————————————————————— Update:

you can use the following command to rename all the files without extension in all subfolders.
for example:

CD:\abc   
for /r %d in (*.) do ren "%d" *.txt

enter image description here

1
  • This could be a workaround, it can add all the files without extension to be .txt in all subfolders. Then you can preview them.
    – OOOO
    Aug 2, 2018 at 7:42
1

Open the folder. Click on the empty area in address bar. Type cmd and press Enter. This should open the command prompt.

Type this command and confirm with Enter:

ren * *.txt

All files will have .txt appended to their names.

1
  • Thank you for the suggestion. Unfortunately the thousands of emails are saved to hundreds of folders, and those folders contain other types of files such as .pdf
    – posix
    Aug 1, 2018 at 15:08
0

Register a file type handler in the Windows registry for file extension "."

You will need administrator rights to do this.

Save the following snippet to view_extensionless.reg and double click the view_extensionless.reg file.

Accept all the warnings.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.]
"Content Type"="text/plain"
"PerceivedType"="text"
@="txtfile"

[HKEY_CLASSES_ROOT\.\OpenWithProgids]
"VisualStudio.txt.10.0"=""

[HKEY_CLASSES_ROOT\.\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.\ShellNew]
"ItemName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\
  6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\
  00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,\
  2d,00,34,00,37,00,30,00,00,00
"NullFile"=""

The "PerceivedType"="text" tells File Explorer to view it as text in the preview pane.

The rest allows you to double click the file and view it in notepad and also create a new extensionless file - it will appear as an additional New Text Document context menu item.

0

While the command line will do those things and sometimes that is what you need, the GUI program Advance Renamer will allow a lot more flexibility and selectivity.

1
  • 1
    The answer could've been more helpful if the user added liks to the program Dec 7, 2021 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .