Changing file extensions is a common task for Windows users, especially for those who want to modify a file type, like turning a `.txt` file into `.exe`. This article provides a detailed guide on three methods: using File Explorer, Command Prompt, and Windows PowerShell. Each method is explained step-by-step to help you master this skill.
1. Using File Explorer.
- Open File Explorer: Press `Win + E` to open File Explorer and navigate to the directory containing your target file.
- Display File Extensions: Click the “View” tab in the menu bar and check the “File name extensions” box to make file extensions visible.
- Rename the File: Right-click on the target file, choose “Rename” and change its extension from `.txt` to `.exe`. Press Enter, confirm the change when prompted, and the modification is complete.
2. Using Command Prompt (CMD).
- Open Command Prompt: Press `Win + S`, type “CMD” and select “Command Prompt” to open it.
- Navigate to the Target Directory: Copy the directory path of the target file and type the following command to change to that directory:
cd C:\test
- Use the `rename` Command: Execute the following command to change `test.txt` to `test.exe`:
rename test.txt test.exe
Hit Enter to apply the change.
- Verify the Change: Use the `dir` command to list files in the directory and confirm the new extension.
3. Using Windows PowerShell.
- Open Windows PowerShell: Press `Win + S`, search for “PowerShell” and open “Windows PowerShell”.
- Execute the Rename Command: Use the `Rename-Item` command to change the file extension. For example:
Rename-Item -Path "C:\test\test.txt" -NewName "test.exe"
- Check the Result: Open File Explorer to verify that the file extension has been successfully changed.
4. Important Notes.
- Changing a file extension only modifies its type identifier; it doesn’t alter the file’s content.
- Simply renaming a file to `.exe` won’t make it executable unless it contains executable code.
- By following the steps in this guide, you can easily change file extensions using different methods. For more advanced Windows tips, consider subscribing to our premium content section!
5. Demo Video.
You can watch the following demo video by select the subtitle to your preferred subtitle language.