COPY CON command – creates text files. Help with BAT file commands and parameters. copy

Copying the abc.txt file from the current directory to the D:\PROGRAM directory under the same name: COPY abc.txt D:\PROGRAM

Copying the file abc.txt from the current directory to the D:\PROGRAM directory under the new name def.txt: COPY abc.txt D:\PROGRAM\def.txt

Copy all files from txt extension from drive A: to the "My Documents" directory on drive C: COPY A:\*.txt "C:\My Documents"

If you do not specify a target file in the command, the COPY command will create a copy of the source file with the same name, creation date and time as original file, and will place new copy to the current directory on the current disk.

For example, in order to copy all the files from the root directory of drive A: to the current directory, just run the following short command: COPY A:\*.*

When copying, you can specify the names of not only files, but also computer devices as a source or result. For example, in order to print the file abc.txt on a printer, you can use the command to copy this file to the PRN device: COPY abc.txt PRN

The COPY command can also merge (glue) multiple files into one.

To do this, you need to specify a single resulting file and several source ones. This is achieved by using wildcards (? and *) or the format file1 + file2 + file3. For example, to combine files 1.txt and 2.txt into file 3.txt, you can specify next command:

COPY 1.txt+2.txt 3.txt

Combining all files with the dat extension from the current directory into one file all.dat can be done like this:

COPY /B *.dat all.dat

The /B switch is used here to prevent truncating the files being joined, since when combining files, the COPY command by default considers text files.

The COPY command also has its drawbacks. For example, it cannot be used to copy hidden and system files, files zero length, files from subdirectories. Also, if when copying a group COPY files will encounter a file that is in this moment cannot be copied (for example, it is busy with another application), then the copying process will be completely interrupted and the remaining files will not be copied.

XCOPY command

The problems mentioned in the description of the COPY command can be solved using XCOPY commands, which provides much more options when copying.

XCOPY can only work with files and directories, not devices.

The syntax for this command is: XCOPY source [result] [keys]

The XCOPY command has many options, we will only touch on a few of them. The /D[:[date]] key allows you to copy only files that have been modified no earlier specified date. If the date parameter is not specified, then copying will be performed only if the source is newer than the result. For example, the command

XCOPY "C:\My Documents\*.*" "D:\BACKUP\My Documents" /D

will copy to the "D:\BACKUP\My Documents" directory only those files from the "C:\My Documents" directory that have been changed since the last such copying or that were not in "D:\BACKUP\My Documents" at all.

The /S switch allows you to copy all non-empty subdirectories in the source directory. Using the /E switch, you can copy all subdirectories, including empty ones.

If the /C switch is specified, copying will continue even if errors occur. This is useful for copy operations performed on groups of files, e.g. backup data.

The /I switch is important when multiple files are copied and the destination file is missing. When this switch is specified, the XCOPY command assumes that the destination file must be a directory.

DIR Team

Another useful command is DIR [drive:][path][filename] [keys], which is used to display information about the contents of drives and directories. The [drive:][path] parameter specifies the drive and directory whose contents should be displayed. The [filename] parameter specifies the file or group of files to be included in the list. For example, the command DIR C:\*.bat

will display all files with bat extension V root directory drive C:.

If you specify this command without parameters, the disk label and serial number, the names (in short and long versions) of files and subdirectories located in the current directory, as well as the date and time of their last modification are displayed.

It then displays the number of files in the directory, the total size (in bytes) occupied by the files, and the amount of free disk space.

For example:

The volume on device C is labeled PHYS1_PART2

Serial number Volume: 366D-6107

Contents of the folder C:\aditor

. <ПАПКА> 25.01.00 17:15 .

.. <ПАПКА> 25.01.00 17:15 ..

TEMPLT02 DAT 227 08/07/98 1:00 templt02.dat

UNINST1 000 1 093 03/02/99 8:36 UNINST1.000

HILITE DAT 1 082 09.18.98 18:55 hilite.dat

TEMPLT01 DAT 48 08/07/98 1:00 templt01.dat

UNINST0 000 40 960 04/15/98 2:08 UNINST0.000

TTABLE DAT 357 08/07/98 1:00 ttable.dat

ADITOR EXE 461 312 12/01/99 23:13 aditor.exe

README TXT 3 974 01/25/00 17:26 readme.txt

ADITOR HLP 24 594 08.10.98 23:12 aditor.hlp

TEXT~1 TXT 0 03/11/01 9:02 Text file.txt

11 files 533,647 bytes

2 folders 143,261,696 bytes free

MKDIR and RMDIR commands

To create a new directory and delete an existing empty directory, use MKDIR teams[drive:]path and RMDIR [drive:]path [keys] respectively (or their short equivalents MD and RD). For example:

MKDIR "C:\Examples"

RMDIR "C:\Examples"

The MKDIR command cannot be executed if the directory or file with given name already exists. The RMDIR command will fail if the directory being deleted is not empty.

DEL command

You can delete one or more files using the command

DEL [drive:][path]filename [keys]

Are wildcards used to delete multiple files at once? And *. The /S key allows you to delete specified files from all subdirectories, the /F key allows you to forcefully delete read-only files, the /A[[:]attributes] key allows you to select files for deletion by attributes (similar to the /A[[:]attributes key ] in the DIR command).

REN Team

You can rename files and directories using the RENAME (REN) command. The syntax for this command is next view:

REN [drive:][path][directory1|file1] [directory2|file2]

Here directory1|file1 specifies the directory/file name to be changed, and directory2|file2 specifies the new directory/file name. Can wildcards be used in any parameter of the REN command? And *. In this case, the symbols represented by the templates in the file2 parameter will be identical to the corresponding symbols in the file1 parameter. For example, to change the extension to doc for all files with a txt extension in the current directory, you need to enter the following command:

If a file named file2 already exists, the REN command will stop executing and display a message indicating that the file already exists or is in use.

MOVE command

The command syntax for moving one or more files is:

MOVE [drive:][path]file_name1[,...] resulting_file

The command syntax for renaming a folder is:

MOVE [drive:][path]directory1 directory2

Here, the resulting_file parameter specifies the new location of the file and can include a drive name, a colon, a directory name, or a combination of these. If only one file is being moved, you can specify a new file name. This allows you to immediately move and rename the file. For example,

MOVE "C:\My Documents\list.txt" D:\list.txt

If the /-Y switch is specified, a confirmation request will be issued when creating directories and replacing files. The /Y switch cancels issuing such a request.

Clearing the command line screen.

To clear the screen of text, use the directive cls .

Text in the command line window
To copy and paste text into a command prompt window, the usual Windows combinations keys such as Ctrl+C, Ctrl+V will not work. To extract text from the clipboard you will have to bring up the menu by clicking right click mouse on the window title, and select the Edit submenu. Or simply right-click on the window. To copy text from the window, select Mark and use the mouse to highlight required text. Then either press Enter or select Copy from the same menu. If you need to paste some text into the command line window, refer to the command Paste(insert).

Re-execute the command.

To re-execute a command, use the up and down arrows to navigate through the list of executed commands.

Commands for maintenance hard drives

Team defrag.

Optimization hard drive allows you to execute the command defrag .

The utility can defragment disks with file FAT system, FAT32 and NTFS. Defrag works equally well with both dynamic type disk, and with the base one. The syntax for calling this command is as follows:

defrag disk [ -a j [ -f ] [ -v ] [ -? ]

The -a parameter only provides for the analysis of information on the disk;

F - optimization of information, including in the absence of the necessary disk space for creating temporary files, and parameter;

V - output of a report on the optimization progress.

For defragmentation to succeed, the disk must contain at least 15% free space.

diskpart command

Team fdisk is no longer supported by the OS kernel starting from Windows Server 2003.

She was replaced by a team diskpart, also intended for maintenance of hard disks. Partition the disk and create logical drives, remove them - these are just some of the tasks solved by this utility.

Mainly the team diskpart is focused on working with special script files that describe hard drive maintenance procedures.

Systeminfo utility

Utility Systeminfo provides detailed information about the computer configuration and its operating system: PC name, type of installed OS, its version, number of processors, their clock frequency and much more.

Among other things, with the help of this utility you can track how long the OS runs without rebooting.

Shutdown utility

By using Shutdown utilities The local or remote computer is turned off or rebooted.

Its parameters allow you to set the time after which the action will occur, the user will receive a message, as well as an explanation of the reason for the shutdown.

Taskkill utility.

Windows XP introduced the ability to complete tasks from the command line.

This can be done using the taskkill utility.

In order to complete a task, you must first find out its number using the tasklist utility.

Both utilities mentioned above allow you to create filters for the tasks being processed.

For example, the command tasklist /fi "status eq not responding" will display a list of all hung tasks, and the command taskkill /f /fi "username eq Guest" will terminate all tasks started by the Guest user.

Openfiles /query command.

To view all open files on the system, you can use the openfiles /query command. It will identify all files opened both locally and remotely, and will also show the name of the process using them.

The openfiles /disconnect command disables remote users from shared files on your computer.

Fsutil hardlink command
Team Fsutil hardlink takes only one parameter - create.

This command allows you to create hard links to files. Hard links allow one file to have several different names. The same file can appear in different directories or even in the same directory as different names. And the data of this file cannot be deleted until the file name count is equal to zero. Since all the links point to the same file, programs can open any of them and modify the original file.
Let's give an example of using this command.

Let's say there is a file d:1.avi that occupies 600 MB. By using the fsutil hardlink create d:2.avi d:1.avi command, you create a hard link to this file. As a result, you will receive two files, but the amount of disk space consumed will not change. Although if you select these two files, you will be shown that they occupy 1200 megabytes. This way you can create an unlimited number of copies of any file, without affecting the occupied disk space in any way. Moreover, if you delete one of these clones, all the others will remain unchanged. In order to destroy the source file, you will have to remove all hard links to it. But this command has limitations: all files must be within the same volume, and file system- NTFS (NT File System) only.

Apple companies. Sales are breaking all records, which means that millions of users will soon face the difficulties of switching from Android to iOS. Moreover, the screens of the new iPhones have increased to 4.7″ and 5.5″, and more customization options have been added to the operating system. To make this process painless, and to ensure that all information remains safe and sound, Lifehacker has prepared instructions for you in six simple steps.

Add email accounts

If you used different addresses on Android Email, just add them all to your iPhone. Next, in the settings of each of them, select contacts, calendars, notes and mail for synchronization.

If you have saved contacts and calendars on your Android smartphone, install one of special applications, which will help you transfer all information without loss. Many of them provide transfers via Wi-Fi, so you don’t have to connect your smartphones to your computer.

For example, use the program Copy My Data. It can be downloaded for free for both platforms and can easily transfer all the necessary data. Just install the app on both smartphones and follow the instructions.

Log in to social networks

If your contacts and calendars were linked to Facebook or Twitter, install the corresponding applications on your iPhone. Next, go to settings and link to the social network you need.




After this you will be able to sync necessary information by switching the sliders "Calendars" And "Contacts".

Use specialized applications

The easiest way to transfer all your photos and videos from your smartphone to your smartphone is to use one of the dedicated apps. Similar to contacts, you just need to install one of these programs on both of your devices and, following the prompts, synchronize your gadgets via Wi-Fi.

Sync with iTunes

You can also move your photos from Android to iOS using iTunes. To do this, just follow the following sequence of actions:

  1. Connect your Android smartphone to your computer and find photos and videos there. They are often located in the folder DCIM → Camera. If you have Mac computer, install free application Android File Transfer and follow a similar path inside the program.
  2. Copy photos from your smartphone memory to separate folder on your computer.
  3. Connect your iPhone to your computer.
  4. Open iTunes and go to your iPhone's page.
  5. Go to the tab "Photo", check the box next to "Sync photos from:" and select the folder containing the copied photos. If you also want to move the video, check the box "Enable video synchronization".
  6. Click Apply in the lower right corner of the window.

Uploaded photos can be found in the section "Albums" applications "Photo".

Use streaming services

If you used on Android, just install them on your iPhone. This could be Spotify, Rdio, Yandex.Music or the less popular Pandora and Beats Music. Enter your account details and continue listening to music.

Import from computer

The instructions are the same as when syncing photos using iTunes.

  1. Find in the folder Music your smartphone or in a similar section of the application Android File Transfer , if you have a Mac, music.
  2. Select the tracks you need and copy them to a separate folder on your computer.
  3. Open iTunes and in the main window select the tab "Music".
  4. Move tracks from the selected folder to your open music library.
  5. Go to your iPhone page and in the “Music” section, select either the entire library of songs, or some individual ones, a specific artist, or album.
  6. Click "Sync" and the music will appear on your iPhone.

Import ePub files using iTunes

The instructions are similar to the previous two cases:

  1. Find books and PDFs in the Documents section of your smartphone. Mac owners You should look for a similar folder inside the application Android File Transfer.
  2. Copy the files you need to a separate folder.
  3. Drag books and PDFs into a section iBooks → Lists or iTunes → “Books” in case of using Windows.
  4. Open iTunes, select the books you need and sync.

You will find PDF files in the section of the same name iBooks apps your smartphone.

Use third party apps

If you've ever downloaded books using your Kindle, Google Play Books or Nook, just download the corresponding apps to your iPhone. After that, enter your username and password and enjoy reading.

Import into iWork office suite using iCloud

First of all, you need to install a set of applications iWork. Owners of gadgets purchased after September 2013 can download all three of these applications for free. The rest will have to pay 329 rubles for each of them.

  1. If during setup new iPhone you forgot to enable iCloud synchronization, follow this sequence of actions.
    Go to menu "Settings" → iCloud. By selecting "Account" Sign in using your Apple ID. If you don't have one, just create a new one.
  2. Return to menu " Settings", find there the right application and switch the slider "Use iCloud".

Exactly as in the previous examples, move the documents from the section Documents(Android File Transfer → Documents) to a separate folder on your computer.




To upload documents to iCloud, sign in to iCloud.com using your Apple ID and password. Then select one of the applications depending on the type of your document. Just drag and drop required file inside the program and it will load into cloud storage and will appear on all devices linked to this Apple ID.

The App Store boasts more than 900,000 apps, which is a quarter more than Google Play, and the practice of launching high-profile projects first on iOS is normal. Whatever you use on Android, you will probably find a replacement or the same application on iOS.


The XCopy utility is one of the oldest and most useful data transfer tools. The purpose of XCopy is to change the location of folders. Explorer has largely replaced this utility, and we recommend using it whenever possible. However, there are several important uses XCopy utilities:

  • scripts for file manipulation;
  • moving separate files in a complex structure;
  • copying all available files, even if some files cannot be moved;
  • archiving data from one system to another;
  • moving files with specific attributes.

Many people use XCopy as their archiving application because it does a great job. You can easily copy data files from a folder to archival media, such as another HDD, floppy disk, Zip drive, or network drive. Unfortunately, XCopy does not support traditional media such as magnetic tape. In addition, the media you are copying to must be partitioned, so XCopy does not allow you to burn files to CDs.

How to use?

The XCopy utility is used in the same way as standard command copying - indicating the source and target files. For example, to copy all files from the MyDir folder on drive C to the same folder on drive D, enter the command:

XCopy C:\MyDir\*.* D:\MyDir\*.*

Then click Enter key. The XCopy utility supports a set of keys, the most important of which are listed below.

Additional keys

/A and /M- are copied only archive files. With these keys, the XCopy utility can be used for archiving. The /M switch also resets the archive attribute on copied files, indicating that they have been backed up. Therefore, when using XCopy as an archiving application, you should only use the /M switch.

/C- continues copying even if data errors occur. Use this function to copy from damaged folder all possible contents to a new location. Explorer does not have this function - copying stops after the first error.

/G- allows you to copy encrypted files to a location that does not support encryption. This function decrypts the file and you must have the appropriate system rights to run it.

/H- copies hidden and system files.

/K- copies file attributes along with the files themselves. IN normal mode The XCopy utility strips files of the read-only attribute.

/O and /X- protection of copied files. The /O key, along with the file, copies information about its owner and the access control table. The access control table contains information about the users who have access rights to the file and the actions they can perform with it. The /X switch also copies the file's audit information. This feature is important when monitoring file access.

/R- overwrites files with the read-only attribute when copying. Use this key when archiving to ensure that write-protected file versions are updated in the backup.

/S and /E- copy files not only from current folder, but also from all subfolders in it. The /E switch also copies empty subfolders. The specified keys allow you not only to copy files, but also to preserve the folder structure.

/T- creates a copy of the original folder structure without copying any files. Use this feature to create new projects. Sometimes it is useful to simply repeat the folder structure without copying specific information from it.

/U- copies from the source folder only those files that are present in the target folder. This feature helps update a portion of the files in the target folder, eliminating the need to specify each file individually.

/V- checks all copied files, comparing their contents with the original files. This switch increases the copying time, but it should always be used when archiving using the XCopy utility. Otherwise, there is a risk of entering backup copy corrupted data and no way to know about it.

HDDRawCopy - free program to create and restore images of hard drives and other storage media. This program is also useful for some Android devices. It allows you to do full image phone's flash memory and restore at any time. Also designed to restore the phone in case of a system crash, or even restore " bricks" in most cases. The program uses bitwise copying, which makes it possible to recreate exact copy systems. It takes about 20 minutes to copy 4GB of our smartphone.

The site administration is not responsible for what you do with your phone. Before you do anything, think about why you need it and carefully study the instructions.

DFU Mode - Firmware mode ( internal flush memory, including service areas) of the phone using the manufacturer's utilities or the QPST utility. Allows you to reflash your phone with any firmware, restore it from brick mode, change IMEI, etc. low-level actions with phone software.

Creating an image via HDDRawCopy

2. Restart your computer.

3. Turn off the phone.

5. Connect to computer.

6. Refuse to format the flash drive. (A sign that the computer saw the phone in DFU mode)

7. Release the phone buttons.

8. Run HDDRawCopy1.02Portable.exe as administrator, click Agree.

9. Select the Qualcomm MMC Storage device and click Continue.

10. Choose double click FILE and indicate where to save our image.

11. Click Continue.

12. Click Start and wait for the image creation process to complete .imgc.

13. Close the program.

14. Remove and insert the battery.

15. Turn on the phone.

Creating a clean image "like from a store" using HDDRawCopy

If you already have some important data on your phone, then make a backup first. Otherwise all data will be lost!

1. Go to settings, select " Recovery and reset"and we do" Copying data".

2. Go to settings, select "Memory" and " Clear phone memory" (Internal, not SD card!)

4. Restart your computer.

5. Download HDDRawCopy1.02Portable.exe.

Download HDDRawCopy1.02Portable.exe 3602

6. Remove back cover phone.

7. Go to settings, select " Recovery and reset" and do "Reset settings". There is no need to clear the SD card!

8. The phone will reboot into mode Recovery, and the system will automatically begin cleaning. When the message appears reboot, the phone will turn off with vibration. At this point, remove the battery to prevent the system from restarting.

We got the phone" like from a store".

9. Insert the battery.

10. Make a full backup according to the instructions " Creating an image via HDDRawCopy"

Firmware using HDDRawCopy

2. Restart your computer.

3. Turn off the phone.

4. Press and hold the Volume + and Volume - buttons

And in this post I'll look into replacing and copying files via command line, namely, the COPY and REPLACE utilities. But first, as always, some silent lyrics.

Perhaps every programmer has encountered the question of writing a function to copy a directory with files. As a rule, these problems were solved using recursion. In the old days, there was no mouse and right-click with the “copy, cut, paste” tab, and the blue Volkov did not immediately appear. It’s all so familiar now, you sit at the keyboard, plug it into the green field of Windows, click here, click here, and that’s it, you’ve solved the problem. But there were also difficult situations when we had to resort to a blue manager. Oddly enough, the command line and its utilities change their appearance from version to version. There is even a whole set of utilities like PsUtils, which are more effective than standard DOS ones. Logical question, who needs all this! What's the point of inventing a modern dinosaur, yop te! On the other hand, such is our human nature, we are even ready to reinvent the wheel just to occupy our minds.

Command line COPY

This masterpiece of human thought allows you to copy a file or files or even concatenate them via the command line. To solve such problems, the script server provides the FileSystemObject object method. The syntax for the copy command line utility is quite intimidating:

COPY source [+ source [+ ...]] [result]

Let's start:

/D– indicates the possibility of creating an encrypted file.

/Y | /-Y– if the first parameter is selected, then there will be no system prompts for confirmation during copying (in other words, if you have to copy 1000 files in bulk, then the annoying “ “ Are you sure, or maybe call a friend?"), it is clear that the second parameter includes a confirmation request.

/Z– allows you to copy data over the network; by the way, this key was not present in previous versions of this utility.

/A– indicates that the file is a text file if we specify this parameter, then copying will be interrupted at the end of file mark ASCII code 26.

If this parameter is indicated at the very end, then the effect is completely different. will happen full copy document, but an end-of-file mark will be added to the copy if it was not there. As a result, you can try experimenting with pdf document(my_file.pdf – document size is 247217 bytes):

copy my_file.pdf/A new_file.pdf– at the output we will receive a document new_file.pdf with a size of 2538 bytes.

/Bgiven key goes by default and indicates that the file is binary. That is, the entire document is copied.

/V– this parameter enables checking the correctness of copying by comparing the data after the procedure is completed.

And so the command line, copying files and a couple of examples:

Copying the 123.txt file from the current directory to the D:\NEW directory under the same name via the command line:

COPY 123.txt D:\NEW

Copying file 123.txt from the current directory to the D:\NEW directory under the new name new.txt:

COPY 123.txt D:\NEW\new.txt

Copying all documents with a txt extension from drive D:\ to the My Data directory on drive C:

COPY D:\*.txt "C:\My Data"

Let's say we are in the D:\NEW directory and we need to copy all the data from the C:\DATA directory into it, in this case it is enough to write the following syntax:

COPY C:\DATA *.*

Using the command line, copied files can be merged. For these purposes, it is enough to use the plus sign “+”, for example:

COPY 1.txt +2.txt 3.txt- V in this example the contents of documents 1.txt and 2.txt have been merged into 3.txt. It is worth remembering that by default, the COPY utility perceives data as text.

Here's an example with binary data:

COPY /B *.dat all.dat- V this option all data with the dat extension from the current folder have been combined into one file all.dat.

In general, using the plus symbol “+” and thinking like “what if”, you can do a couple of experiments. It is also worth remembering a number of points:

If the name of the target object is the same as one of the copies (except the first one), then the original contents of the target object will be lost.

If the name of the target object is omitted, then the first object from the list will be used as it:.

COPY 1.txt +,– this construction allows you to assign 1.txt to an object current date without modifying it.

The COPY utility, due to its primacy, contains a number of disadvantages:

  • You cannot copy files via the command line with the hidden or system attributes, as well as system files with the “Read-Only” attribute.
  • interruption of the entire copying process when encountering an object that cannot currently be copied.

Due to such inconveniences, smart people thought and added the letter X to the name COPY, which solved a lot of problems by creating .

REPLACE Command Line

In fact, the difference between this utility is that it can replace data. The syntax is quite simple and clear:

REPLACE [drive1:][path1]filename [drive2:] [path2]

REPLACE [drive1:][path1]filename [drive2:] [path2]

[drive1:] [path1]filename – determine the location of the copied object, or objects.

[drive2:] [path2] - determine the location of the result object. As you can see, names of replaced objects cannot be specified.

/A– add to the result directory only new objects from the result directory (without overwriting). This key cannot be used with keys /S And /u.

/R– You are prompted for confirmation before replacing the target or adding the source file.

/R– replacement of not only ordinary, but also write-protected documents.

/S– allows you to search all subdirectories of the target directory and replace files with matching names. This key cannot be used in conjunction with the /A. Search in catalogs, specified by parameter path1, not produced.

/W– wait for the disk to be inserted before starting execution

/U– update mode, that is, only those objects that have an earlier modification date will be replaced. Key incompatibility /A.

Replace D:\Data\my_file.txt D:\Work– in the Work folder, replace the file my_file.txt with D:\Data\my_file.txt

When copying files via the command line using the REPLACE utility, there is no way to update hidden or system files. To do this, you must first change their attributes.