Want to copy the file name quickly in Windows. I always use rename, copy , but feel it is quite slow. Any better way?
6 Answers
Press F2 to rename, Ctrl+C to copy. Two keystrokes without any additional utilities.
-
Bonus info for Mac OS X users: Press
Return
to rename,Cmd-C
to copy.– Daniel Beck ♦Jan 5, 2011 at 6:41 -
1Not a complete answer. Filename extension isn't selected when renaming. Sep 17, 2017 at 23:02
-
@user598527 Ctrl-A should do it, but haven't used Windows in years. Could have tested this on a throwaway VM without known file extensions shown, or perhaps it was different back then if you're on Windows 10 now. Looking over the other answers, three keystrokes still come out ahead.– Daniel Beck ♦Sep 18, 2017 at 0:45
-
You can get a free context menu utility, rightfully named "Copy File Name Utility", that will add that option to files:
Compatible with XP, Vista, 7 (32 and 64-bit editions). Just 11kb.
-
In Windows 10, it asks to open the file, and I don't know how to copy the name to my clipboard.– ahornOct 2, 2020 at 9:27
I know it's an old question but I was also looking for a way to do this and if you select the files you need and then press shift + right click -> 'copy as path', you can get the complete file paths without using the command prompt. Then you can use a quick find and replace to remove the parts of the paths that you don't need. It takes about five seconds.
-
Best answer I've ever seen. Does exactly what I have to do so often but using just one click. Only niggle is that it has double quotes around it but some of the time that's handy Jun 4, 2021 at 16:18
-
Excellent - the rename approach never seemed to me the right approach but had no alternative until now. Verified on Win10 Feb 15 at 23:51
If you are just trying to copy the files names into the clipboard try the following -
- Click Start, click Run, type cmd, and then click OK.
- change to the appropriate directory using the
cd
command. - type
dir
- Using the mouse, highlight the file names you want to copy.
- Press the right mouse button - this copies the selected text onto the clipboard.
You may need to enable quick edit mode, follow the instructions here.
Try clicking on a the file and then clicking on it after a short pause it will get into rename mode and then you can copy the name of the file .
Or you can drag the file to run menu and it will show the file name (but along with the file path) .
Or you can do the following if you have too many file names to copy
Launch command prompt
Navigate to the folder you want file names from
Type out the following : dir /d>listoffiles.txt
This will create a txt file with list of all the files/folders in your folder in you D drive.
To get a complete folder of file names;
- Use File Explorer and navigate to the folder you want to list files from.
- Use SHIFT +
Right Click
to show the expanded context menu. - Select
Open command window here
- At command prompt enter
dir >> files.txt
which createsfiles.txt
in the folder with all the file details listed. - Open and edit with your preferred text editor.
-
Here is how to copy all files' names without using the command line: stackoverflow.com/a/17867130/470749– RyanAug 20, 2021 at 20:42
F2
to rename,Ctrl-C
to copy. Two keystrokes without any additional utilities.