Renaming a file in Windows is a routine task, and the keyboard shortcut makes it almost instant. Instead of right-clicking and hunting through a context menu, you can select a file and press a single key to jump straight into edit mode. This guide explains the shortcut, the exact steps, and the small details that trip people up. It applies to File Explorer in current versions of Windows; menu wording and minor behaviour can differ slightly between releases, so treat the steps as a general map rather than a script that is identical everywhere.
What You’ll Need
- A Windows computer with File Explorer available (it is built into Windows).
- At least one file you are allowed to rename. Files in system folders or on a shared drive may be locked by permissions.
- A keyboard with a working function key row, since the shortcut uses a function key.
- Optional: a mouse or touchpad, because some steps are easier to combine with clicking, though the core rename action is keyboard-only.
Step-by-Step
- Open File Explorer. Press the Windows key and the letter E together, or click the folder icon on the taskbar. This opens a window showing your folders and files.
- Navigate to the folder that contains the file you want to rename. Use the arrow keys to move through the folder list, or click the folder in the left pane.
- Click the file once, or use the arrow keys to highlight it. Make sure only that one file is selected; a highlighted background confirms the selection.
- Press the F2 key. This is the rename shortcut. The file name becomes an editable text box with the current name highlighted, and the cursor is placed inside it.
- Type the new name. You can also press the Left or Right arrow key to move the cursor and edit only part of the name instead of replacing everything.
- Press Enter to confirm the rename. The file keeps its contents and location; only the name changes. If you change your mind before pressing Enter, press Esc to cancel and keep the old name.
- Check the result. The file should now show the new name in the folder. If the name is rejected, Windows will show a message explaining why, and the old name stays in place.
That is the whole shortcut: select, press F2, type, press Enter. On some laptops the function row is set to media or brightness actions by default, so F2 may not reach File Explorer. In that case, hold the Fn key while pressing F2, or change the function key behaviour in your keyboard settings. The exact setting name varies by manufacturer, so check your device documentation if the key does not respond.
Common Mistakes
- Renaming the wrong file. If several files are selected, F2 may rename only one of them or behave unpredictably depending on the Windows version. Click a single file first and confirm the highlight before pressing F2.
- Deleting the file extension. When the full name is highlighted, typing replaces the extension too. If you remove or change the extension, Windows may no longer know which program should open the file. To be safe, edit only the part before the dot, or enable file name extensions in File Explorer’s View settings so you can see what you are changing.
- Using characters Windows does not allow. Names cannot contain certain symbols such as a backslash, a forward slash, a colon, an asterisk, a question mark, a quotation mark, or angle brackets. Windows will refuse the name and explain the problem.
- Pressing F2 with nothing selected. Nothing happens, which makes people think the shortcut is broken. Click the file first.
- Expecting the shortcut to work everywhere. F2 renames files and folders in File Explorer, but it does not rename items in every program. In some applications it has a different function entirely.
- Forgetting that the name must be unique. A folder cannot hold two files with exactly the same name. Windows will prompt you to choose a different name or confirm a replacement.
Tips
- Press F2, then use the Home and End keys to jump to the start or end of the name, which is faster than arrow-keying through a long name.
- To rename a folder, the process is the same: select the folder and press F2.
- If you rename many files, do them one at a time with F2 and Enter; it becomes a quick rhythm once you are used to it.
- Keep names short and descriptive, and avoid symbols that other systems or cloud services might handle awkwardly.
- If you are unsure about extensions, turn on the option to show file name extensions before you start editing names.
- Use Ctrl+Z immediately after a rename if you made a mistake; it often undoes the last rename in File Explorer.
Troubleshooting
F2 does nothing. First confirm a single file is selected. If it still does nothing, your laptop’s function row may be in media mode; hold Fn while pressing F2, or adjust the function key setting. Also check that the File Explorer window has focus, not another program.
The name is rejected. Read the message Windows shows. It usually points to an illegal character, a duplicate name, or a permission problem. Remove the offending character or choose a different name.
You cannot rename the file at all. The file may be open in another program, marked read-only, or stored in a location where your account lacks permission. Close the program using the file, check the file’s properties for a read-only setting, or ask the person who manages the folder for access.
The file type changed and the file will not open. You likely altered the extension. Rename it again and restore the original extension, or use Ctrl+Z to undo. If you are unsure of the original extension, check the file’s properties or a backup copy.
The rename seems to work but the old name returns. A sync service or another program may be restoring the name, or the file may be on a network location with restricted write access. Wait for syncing to finish and try again, or contact whoever administers the location.
Frequently Asked Questions
What is the keyboard shortcut to rename a file in Windows? Select the file in File Explorer and press F2. The name becomes editable, and Enter confirms the change.
Why does F2 not work on my laptop? Many laptops assign media or brightness actions to the function row by default. Hold Fn while pressing F2, or change the function key behaviour in your keyboard settings.
Can I rename a file without a mouse? Yes. Open File Explorer with the Windows key and E, use the arrow keys to reach the file, press F2, type the new name, and press Enter.
Does renaming a file change its contents? No. The file stays exactly the same; only its name changes. Be careful not to change the extension, because that can affect which program opens the file.
How do I cancel a rename? Press Esc before confirming. The original name is kept.
Can I rename a folder the same way? Yes. Select the folder and press F2. The rules about illegal characters and duplicate names apply just as they do to files.