您(Did)是否只是下载了一个没有扩展名的文件?您可能注意到Windows无法打开此文件并提示您选择一个程序来打开它。
如果您已经知道基于源的文件类型,您只需选择一个您想要打开文件的程序(select a program you want to open the file)并将其设置为将来的默认值。如果您不知道文件类型,本文将向您展示如何打开没有扩展名的文件。
确保(Make)文件没有扩展名
您应该首先确认您的文件是否实际上没有扩展名,或者您只是没有打开特定文件类型所需的程序。
您可以从 Windows 文件资源管理器的类型(Type)列中检查文件扩展名。
或者,您可以右键单击该文件并选择Properties。您将在文件属性的常规选项卡中看到(General)文件类型。(Type of file)
如果它显示File,您就知道该文件没有扩展名。
还有另一种显示文件扩展名的方法。只需(Just)选择一个文件,然后从顶部功能区中选择查看选项卡。(View)选中文件扩展名(File name extensions)旁边的框。您现在将看到所有具有扩展名的文件都将在文件名后提及其扩展名。
如果一个文件没有显示扩展名,它可能没有扩展名。但是,如果您的文件确实有扩展名但您仍然无法打开它,该怎么办?
查找文件扩展名的程序
如果您的文件确实有扩展名,但您仍然无法打开它,那是因为您的系统上没有安装正确的程序。如果要打开文件,首先需要安装一个可以打开具有该扩展名的文件的程序。
由于您已经知道文件的扩展名,请前往fileinfo.com并在搜索栏中输入文件的扩展名。
完成后,您将看到用于打开文件的程序列表。只需(Just)安装其中一个程序,然后尝试打开您的文件。
但是,如果文件没有扩展名,您将需要采用不同的方法。
使用工具利
Toolsley是一个免费的基于 Web 的工具,可帮助识别文件扩展名。它不需要安装任何第三方软件,也不需要上传任何文件。该工具使用JavaScript来识别系统上本地的文件。
- 去托斯利(Toolsley)。
- 选择选择文件(Select a file)。
- 浏览(Browse)您的计算机以查找文件,或者只是将文件拖放到浏览器窗口中。
- 您将在下面的绿色框中看到文件类型。
使用机器人
让我们花点时间感谢英国政府提供的DROID ,这是一个由(DROID)国家(National)档案馆(Archives)开发的免费开源(GitHub 存储库(GitHub repository))工具,用于批量识别文件格式。该工具使用文件的内部签名来识别文件格式和版本。
虽然您需要将该工具下载到您的系统上,但DROID工具与(DROID)Toolsley 相比(Toolsley)有两个好处。
首先,如果您有大量没有扩展名的文件,您将使用DROID节省时间,而不是在(DROID)Toolsley上检查单个文件。其次(Second),由于它是英国政府开发的产品,您的信息将更加安全。
- 下载机器人(DROID)。
- 将 .zip 文件中的文件提取到文件夹中。如果您使用WinRAR,请选择所有文件,从顶部选择“提取(Extract) 到”,选择要提取文件的位置,然后选择“(To )确定(OK)” 。
- 导航到您提取文件的文件夹并运行droid.bat,这将启动 DROID。
- 从顶部选择添加(Add )以添加您的文件。选择没有扩展名的文件,然后选择OK。
- 添加所有文件后,从顶部选择“开始”按钮。(Start)
- 您将看到格式(Format)列中列出的文件扩展名。
使用十六进制编辑器
前两种方法应该对每个人都有效。但是,如果您的 PC 上已有十六进制编辑器,并且不想将文件上传到网站或下载DROID程序,则可以使用十六进制编辑器来识别文件的扩展名。
请注意,此方法并非在所有情况下都有效;我们稍后会讨论为什么。
我们使用Hex Editor Neo免费版进行插图,但任何十六进制编辑器的方法都相同。
- 启动(Launch)您拥有的任何其他十六进制编辑器,然后按Ctrl + O 在十六进制编辑器中打开文件。
- 打开文件。您会在屏幕上看到很多数字。跳到(Skip)数字块的右端,您将在其中看到文件扩展名。
- 如果您没有看到文件扩展名,请滚动文本以找到它。
例如,这是打开Word文件时十六进制编辑器显示的内容:
请注意(Notice)扩展名是 .xml 而不是.docx。这是因为从Office 2007 开始(Office 2007),Microsoft就使用了基于 XML 的格式,例如.docx和.xlsx。
也就是说,当我们将它用于Excel工作表时,这种方法不起作用。我们搜索了整个十六进制,但没有找到扩展名。
您现在可以打开没有扩展名的文件
您现在应该能够识别文件的扩展名,无论您是否安装了适当的程序来打开它。一旦确定了文件扩展名,您甚至可以更改大批量的文件扩展名(change the file extension for a large batch)。
How To Open a File With No Extension
Did you just download a file with no extension? You probably noticed Windows couldn’t open this file and prompted you to choose a program to open it.
If you already know the file type based on the source, you can just select a program you want to open the file with and set it as the default for the future. This article will show you how to open a file with no extension if you don’t know the file type.
Make Sure the File Doesn’t Have an Extension
You should first confirm if your file actually has no extension, or you just don’t have the program needed to open a particular file type.
You can check the file extension from the Type column in Windows file explorer.
Alternatively, you could right-click on the file and select Properties. You’ll see the Type of file in the General tab of file properties.
If it says File, you know that the file has no extension.
There’s another way to reveal a file’s extension. Just select a file and select View tab from the top ribbon. Check the box beside File name extensions. You’ll now see that all files with an extension will have their extensions mentioned after the file name.
If a file doesn’t show an extension, it probably doesn’t have one. However, what should you do if your file does have an extension but you still can’t open it?
Find a Program for a File Extension
If your file does have an extension, but you still can’t open it, it’s because you don’t have the right program installed on your system. If you want to open the file, you’ll first need to install a program that can open a file with that extension.
Since you already know the file’s extension, head over to fileinfo.com and enter your file’s extension in the search bar.
Once you do, you’ll see a list of programs to open the file with. Just install one of those programs, and then try opening your file.
However, if the file has no extension, you’ll need to go a different route.
Use Toolsley
Toolsley is a free web-based tool that helps identify file extensions. It doesn’t require installing any third-party software, and you don’t have to upload any files. The tool uses JavaScript to identify the files locally on your system.
- Go to Toolsley.
- Choose Select a file.
- Browse your computer for the file, or just drag and drop the file into the browser window.
- You’ll see the file type in the green box below.
Use DROID
Let’s take a moment to thank the UK government for DROID, a free open-source (GitHub repository) tool developed by The National Archives to batch identify file formats. The tool uses a file’s internal signature to identify both the file format and version.
While you’ll need to download the tool onto your system, the DROID tool has two benefits over Toolsley.
First, if you have a large batch of files with no extension, you’ll save time using DROID rather than checking for individual files on Toolsley. Second, since it’s a product developed by the UK government, your information will be safer.
- Download DROID.
- Extract the files from the .zip file into a folder. If you use WinRAR, do this by selecting all files, selecting Extract To from the top, selecting a location to extract files, and selecting OK.
- Navigate to the folder where you extracted the files and run droid.bat, which will launch DROID.
- Select Add from the top to add your file(s). Select the files with no extension and select OK.
- When you’ve added all the files, select the Start button from the top.
- You’ll see the file extension listed in the Format column.
Using a Hex Editor
The previous two methods should pretty much work for everyone. However, if you already have a hex editor on your PC and don’t want to upload your file to a website or download the DROID program, you can use the hex editor to identify a file’s extension.
Note that this method doesn’t work in all cases; we’ll talk about why in a moment.
We’ve used the Hex Editor Neo free version for illustrations, but the method remains the same for any hex editor.
- Launch any other hex editor you have and press Ctrl + O to open a file in the hex editor.
- Open the file. You’ll see a lot of numbers on your screen. Skip to the right end of the block of numbers, where you’ll see the file extension.
- If you don’t see the file extension, scroll through the text to find it.
For instance, this is what the hex editor displays when you open a Word file:
Notice how the extension is .xml and not .docx. That’s because since Office 2007, Microsoft has used XML-based formats like .docx and .xlsx.
That said, this method didn’t work when we used it for an Excel sheet. We searched the entire hex but didn’t find the extension.
You Can Now Open Files With No Extension
You should now be able to identify a file’s extension, regardless of whether you have the appropriate program to open it installed or not. Once you’ve identified the file extension, you can even change the file extension for a large batch.