Windows copy command path

Windows copy command syntax and examples

Using copy command, we can copy files from one directory to another directory. This command is similar to the Linux cp command, but it does not match with the full functionality of cp. Windows copy command can be used to copy files only, we can’t copy directories.

The syntax and usecases of copy command are explained below with examples.

Copy the contents of a file to another file

Example: To copy a file from c:\data\file1.doc to D:\backup\file2.doc

If the destination file already exists you will be prompted for confirmation. To suppress this confirmation you can use /Y switch with copy command. This would be useful if you are executing copy command from a batch file.

If the destination file exists, the above command will overwrite the same without asking the user for confirmation.

Copy file to another directory

When we specify a directory path as the destination, the files will be copied with the same name. We can assign a different name by specifying the new name in the destination path. Example is shown below.

To copy the file 1.doc loated at c:\data\documents to the directory c:\data\newdocs

Copy files with white space in name

If the file name has white space within it, we can wrap up the name in double quotes.
Example: To copy file, my resume.doc to another folder

Copy multiple files

We can’t specify multiple file names in copy command. However, we can use wildcards to identify a group of files and then copy all of them in a single command.
For example, to copy all excel files from current folder to another folder F:\backup

To copy all files in current folder to another folder

Use of environment variables

We can use environment variables in the copy command to specify the path of the folders. Like USERPROFILE, SystemRoot, ProgramFiles, TEMP, WINDIR, APPDATA, HOMEPATH.

For example, to copy a file to a user’s documents folder

The above command copies the file to the My Documents folder of the current logged in user.

You may also want to read

Windows «copy» is funny. Type «copy 1 2» and the file «1» will be copied into a new file «2». Now separate them by a plus sign instead of a space (copy 1+2) and you’ll concatenate 1 and 2 and replace the old file «1» with the result of the concatenation!

Yes, we can concatenate two or more files using copy command. You need to separate the list of files using +. You can redirect the resultant data to a new file also.

The above command will not alter the file 1. It creates a new file 3 with the concatenated data of 1 & 2. If no file name is provided it stores the result in the first file.

My Win7 cannot find a copy command, and when i run xcopy, a window flashes and exits.

I have the same problem. If you solved it, could you please explain how?

If you can not find your copy.exe file, you can download it to your windows directory or C:\ Directory depending the setting on your OS you should also be able to copy and run it from system32 or system folder.

how can i combine 2 .exe files and be able to use both after concatenation

I want to copy 2 different files(.exe,.config) from source to destination server of windows.
can you please help me on this command.

Hello i have a problem with my cmd windows 7.when i try to copy a command. Like help > file.pdf. i mean in extension pdf because i have this problem only with .pdf extension but not with .txt.So whe i execute the command. No problem. Then when i go to open the file.pdf ftom user destination the file.pdf doesn’t open say that is corrupted.please do help me .thanks

Читайте также:  Python виртуальное окружение windows venv

i have a file contain many lines as sources and another file has the same numbre of lines as destinations. i want to copy first line as source( c:/test/*.txt) to first line in destination ( d:/test2/), secend line ( c:/test/*.pdf) to second line in destination ( E:/test3/)……

Can I use the DOS/Windows “COPY” command in a BAT file to copy a file or a short string of text to computer memory and then paste (Ctrl +V) that string or file into a document?

How to copy path of a file or a folder in Windows 10

Windows File Explorer is one of the best things about Windows 10 due to the fact it allows the user to gain access to several aspects of the operating system with just a few clicks of the mouse. The most impressive thing about Windows Explorer is the ability for users to improve it even further. In this article, we explain how to copy path a file or a folder in Windows 10/8/7 via Explorer UI or using freeware Path Copy Copy.

Getting the path of a deep-rooted file or a folder in File Explorer can be a daunting task. Many a time we are required to upload the documents to the social media sites or any other sites which forces us to go through numerous folders till you find the desired file. Finding a path to upload a file or a folder in file explorer can be time-consuming. In most cases, it can be quite tedious to traverse to the location of the root directory of a file system. It is indeed tiresome to manually copy the path regularly from the address bar in order to paste it to the desired location.

Copy path of file or folder in Windows 10

Fortunately, there is a provision to easily copy the full path of a file or folder to the clipboard. All thanks to the Windows which is constantly updated with new features that make our life much simpler. In the earlier version of Windows, there is an option called copy path in the file context menu that would let you copy the path of a file or a folder to paste it to your clipboard. In Windows 10, the copy path button is moved to the Home tab ribbon area in the file explorer.

Open Windows File Explorer and traverse to file location whose path you want to copy. Select the file or folder you prefer to copy.

On the Home tab ribbon, click on Copy path button to copy the path of the selected file or folder.

Now paste the path to the desired location or to a clipboard.

Many of us have been improving the feature with third-party software for years, so since we know how well these things can work if done properly, we chose to download and test an app known as Path Copy Copy.

You might be wondering what Path Copy Copy is all about and if it’s worth your time. Here’s the thing, this tool is designed to allow users to copy the path of any file or folder, and this can be done in several formats. The addon is integrated into the file context menu. It also allows you to customize the settings according to your preferences. You can configure the software settings to various copy formats like copying the short name, long name, long path, short path, Unix path, Internet path etc. Additionally, you can configure the settings to encode whitespace, display submenu, display icon next to the submenu and many others.

Path Copy Copy for Windows PC

You can use Path Copy Copy to copy file & folder paths.

Easily Copy Paths

When it comes down to copying paths, this task is quite easy and we’re going to explain how. You see, the user should simply fire up Windows Explorer, locate the file or folder they’re interested in, then press the right-click button.

You should now see the contextual menu with all its many options. The next step, then, is to look for Path Copy and hover the mouse pointer over it. From there, users will see a new list of options from the sub-menu, which is where all the magic happens.

Читайте также:  Windows 10 home version 1909

Select any of the available options to have a copied path, then press CTRL + V to paste the copied items in a Word document or wherever else.

Settings

The Commands area gives the option to remove certain elements from the contextual menu. Not only that but if you want to gain easy access to some of the most Path Copy Copy options, the ability is there to place them in the main menu.

Right now, all features are available via the sub-menu, which is a good thing because it doesn’t allow for the cluttering up of the main menu.

In terms of the Options tab, this is where folks can decide if they want the sub-menu or everything in one place. We suggest never unchecking this feature because things will become cluttered and difficult to get under control, even if you’re a power user.

Additionally, a click of the mouse can add quotes around copied paths with relative ease. Furthermore, if you’re interested in copying multiple paths on the same line, just tick the box that says “Copy multiple paths on the same line.”

Here’s the list of all the copy formats supported:

  • Copy Short Name
  • Copy Long Name
  • Copy Short Path
  • Copy Long Path
  • Copy Short Parent Folder Path
  • Copy Long Parent Folder Path
  • Copy Short UNC Path
  • Copy Long UNC Path
  • Copy Short UNC Parent Folder Path
  • Copy Long UNC Parent Folder Path
  • Copy Internet Path
  • Copy Unix Path
  • Copy Cygwin Path

Personally, I’m not the one to regular copy paths, therefore, Path Copy Copy is not for me. However, if you’re the opposite of who I am, then chances are you’ll find this tool immensely useful for a long time to come. You can download Path Copy Copy from GitHub.

Date: December 17, 2018 Tags: Explorer, Freeware

Команда COPY: копирование файлов в командной строке Windows

Для копирования одного и нескольких файлов в командной строке Windows существует команда COPY. Она довольно проста в использовании и при этом весьма функциональна.

Синтаксис команды copy :

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B] источник [/A | /B] [+ источник [/A | /B] [+ …]] [результат [/A | /B]]

/D — указывает на возможность создания зашифрованного файла;

/V — проверка правильности копирования файлов включена;

/N — использование коротких имён при копировании файлов (используется для совместимости с программами MS-DOS);

/Y — отключение запроса на подтверждение перезаписи существующих файлов;

/-Y — включение запроса на подтверждение перезаписи существующих файлов;

/Z — копирование сетевых файлов с возобновлением, ключ /Y можно установить через переменную среды COPYCMD;

/A — копируемый файл является текстовым файлом ASCII;

/B — копируемый файл является двоичным файлом;

источник — имена одного или нескольких копируемых файлов с их расположением;

результат — каталог и/или имя для конечных файлов.

По умолчанию осуществляется копирование файлов как двоичных «один к одному», поэтому параметр /B указывать не обязательно. Параметр /A следует использовать, если при копировании должны обрабатываться специальные символы, которые применяются в текстовых файлах.

По умолчанию команда copy требует подтверждения перезаписи существующих файлов, если не выполняется в пакетном файле.

Кроме этого, команду copy можно использовать и для объединения существующих файлов.

Примеры использования команды copy :

Копировать file1.txt в file2.txt в текущем каталоге:

Если file2.txt существует, то будет выведен запрос на перезапись файла. Не нужен подобный запрос? Тогда команда примет следующий вид:

Объединение файлов file1.txt, file2.txt и file3.txt в файл file4.txt:

Копирование всех файлов с расширением txt из текущего каталога в каталог C:\new folder.

Обратите внимание, что, если в пути к файлам встречаются пробелы, нужно использовать кавычки.

Команда copy может применяться и для копирования с использованием стандартных устройств ввода-вывода.

Копирование с устройства con (консоль) в файл C:\file.txt:

Для завершения ввода используйте Ctrl+Z или F6.

Копирование с фиктивного устройства nul в файл C:\file.txt. Данная команда создаст пустой файл:

Копировать файл на фиктивное устройство nul:

Такая команда выполнит операцию чтения и может быть использована для тестирования носителей данных.

Copy Path in File Explorer in Windows 10

How to Copy Path in File Explorer in Windows 10

In this article, I would like to share a number of methods you can use to copy the full path to a file or folder in Windows 10 File Explorer. While it is a trivial task, there are a few tidbits you will definitely find interesting and useful.

Читайте также:  Чем записать windows flash

File Explorer is the default file management app which is bundled with Windows starting with Windows 95. Besides file management operations, Explorer.exe also implements the shell — the Desktop, taskbar, desktop icons and also the Start menu are parts of the Explorer app. Note: In Windows 10, the Start menu is a special UWP app, which is integrated into the shell. Starting with Windows 8, File Explorer got the Ribbon user interface and the quick access toolbar.

Sometimes it is very useful to copy the full path to a file or a folder, especially when it is stored under the long directory hierarchy. You may need to upload a document online, or attach it to an email. In this case, browsing the file system is a time consuming task. If you already have the path to the file in the Windows clipboard, it can be retrieved with a single keystroke.

In Windows 10, there are several ways to use the copy as path command. It is available directly in the Ribbon user interface, from the file context menu, and from the context menu of the address bar. Let’s review these methods.

To Copy Path in File Explorer in Windows 10,

  1. Open File Explorer.
  2. Navigate to the folder that contains your file.
  3. In the Ribbon user interface of Explorer, click Home > Copy path.
  4. Now, open Notepad and paste the clipboard contents (Ctrl + V). You will see the path to the file surrounded by quotes.

Alternatively, you can right-click the address bar in File Explorer and use the copy commands from there. This method only works for folders but not for files.

Copy Path from File Explorer Address Bar Context Menu

  1. Navigate to the destination folder.
  2. Right-click on the address bar.
  3. From the context menu, select Copy address as text.
  4. This will put the path to the current folder to the clipboard without quotes.
  5. You can also use the Copy address command. See the note.

Note: You might be wondering what is the difference between the Copy address and Copy address as text commands. Technically, both allow you to copy the path and paste it to another app, e.g. Notepad. However, the Copy address command puts the folder (the file system object) to the clipboard, so you can paste it to another location or even in a different file management app like Total Commander.

Finally, you can simply click into the address bar area, so will become editable.

Also, you can move the cursor to that area by pressing Alt + L or Alt + D . Then simply press Ctrl + C to copy the path.

Copy Path from File Explorer Context Menu

  1. Open File Explorer.
  2. Navigate to the destination folder.
  3. Press and hold the Shift key and right-click a file or folder in File Explorer.
  4. A hidden command Copy as path will appear in the context menu.

Tip: If you are frequently using the context menu option, it is a good idea to make the command always visible in the context menu. Check out the following post:

Paste Paths to Command Prompt and PowerShell Faster

Not so many people seem to be aware that it is possible to drag the desired file or folder directly to the command prompt window to paste it’s path into the command prompt. This is extremely handy if you need to paste the path of the several files or repeat this task for many objects one by one.

Just select some file or folder in File Explorer and drag it to the opened command prompt. In the example below, I did that with the «private» folder:

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

Share this post

About Sergey Tkachenko

Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Оцените статью