11

Want to copy the file name quickly in Windows. I always use rename, copy , but feel it is quite slow. Any better way?

5
  • 5
    Press F2 to rename, Ctrl-C to copy. Two keystrokes without any additional utilities.
    – Daniel Beck
    Jan 5, 2011 at 6:05
  • 1
    @Daniel - I think your comment should be an answer
    – Nifle
    Jan 5, 2011 at 6:07
  • 2
    @Nifle Didn't seem worthy of an answer, but the upvotes and your comment are quite persuasive.
    – Daniel Beck
    Jan 5, 2011 at 6:41
  • 1
    You didn't specify where you're copying the name to, but: if you want to use the file in a command line, then dragging it from Explorer into a cmd window will paste the full pathname there.
    – dave
    Oct 23, 2018 at 22:30
  • Here is how to copy all files' names without using the command line: stackoverflow.com/a/17867130/470749
    – Ryan
    Aug 20, 2021 at 20:42

6 Answers 6

14

Press F2 to rename, Ctrl+C to copy. Two keystrokes without any additional utilities.

4
  • Bonus info for Mac OS X users: Press Return to rename, Cmd-C to copy.
    – Daniel Beck
    Jan 5, 2011 at 6:41
  • 1
    Not a complete answer. Filename extension isn't selected when renaming.
    – user198350
    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
  • Yes, Ctrl + A after F2 selects the full filename.
    – user198350
    Sep 18, 2017 at 10:05
4

You can get a free context menu utility, rightfully named "Copy File Name Utility", that will add that option to files:

alt text

Compatible with XP, Vista, 7 (32 and 64-bit editions). Just 11kb.

1
  • In Windows 10, it asks to open the file, and I don't know how to copy the name to my clipboard.
    – ahorn
    Oct 2, 2020 at 9:27
3

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.

2
  • 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
    – Computable
    Feb 15, 2023 at 23:51
1

If you are just trying to copy the files names into the clipboard try the following -

  1. Click Start, click Run, type cmd, and then click OK.
  2. change to the appropriate directory using the cd command.
  3. type dir
  4. Using the mouse, highlight the file names you want to copy.
  5. 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.

0

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.

0

To get a complete folder of file names;

  1. Use File Explorer and navigate to the folder you want to list files from.
  2. Use SHIFT + Right Click to show the expanded context menu.
  3. Select Open command window here
  4. At command prompt enter dir >> files.txt which creates files.txt in the folder with all the file details listed.
  5. Open and edit with your preferred text editor.
1

You must log in to answer this question.

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