Copying and pasting are two almost indispensable operations when we use a computer. However, have you ever encountered such a situation: you want to copy the names of multiple files or folders at one time, but after you paste them, the file name and the suffix are separated, which is not what you want? This is because when we copy files or folders, the system will automatically copy their full paths by default. If you want to copy only the file or folder name, you need to uncheck the “Copy path with file name” option before pasting. But this is too troublesome. Is there a way to quickly copy only the file or folder name without unchecking this option every time? The answer is yes. The following will introduce two methods: using the command line and using a third-party tool.
Using the command line is a relatively simple and quick method. First, open the command prompt. Then, use the “cd” command to navigate to the directory where the files or folders you want to copy are located. Next, use the “dir /b” command to list all the files and folders in the current directory. Finally, use the “clip” command to copy the output of the “dir /b” command to the clipboard. For example, if you want to copy the names of all the files and folders in the “C:\Users\Public\Documents” directory, you can use the following command:
cd C:\\Users\\Public\\Documents
dir /b | clip
Copying Selected File Names
To copy the names of selected files for pasting, follow these steps:
- In File Explorer, select the files you want to copy the names of.
- Press “Ctrl” + “C” to copy the file names to the clipboard.
- Navigate to the location where you want to paste the file names.
- Press “Ctrl” + “V” to paste the file names.
People Also Ask
How do I copy the names of multiple files at once?
To copy the names of multiple files at once, use the following steps:
- Select the files you want to copy the names of.
- Press “Ctrl” while clicking on each file you want to select.
- Once all files are selected, press “Ctrl” + “C” to copy the file names to the clipboard.
- Navigate to the location where you want to paste the file names.
- Press “Ctrl” + “V” to paste the file names.
How do I copy the full path of a file?
To copy the full path of a file, use the following steps:
- Right-click on the file and select “Properties”.
- In the “Properties” window, navigate to the “Details” tab.
- Locate the “Full path” field and copy the value.