Creating an installation flash drive using the command line. Creating a bootable Windows USB drive via the command line

It often happens that many modern computers do not have a disk drive. This often causes difficulties, especially when you need to install a program from an installation disk. Most often, the problem occurs when installing or reinstalling the Windows operating system on such a computer. To avoid such problems, it is proposed to create bootable usb drive, which will perform all functions exactly like the installation disk.

To create a bootable USB drive or sometimes it is also called a bootable flash drive using the “cmd” command line, you need to perform a simple two-step algorithm. The first stage will involve using a standard utility called diskpart.

How diskpart works

Creating a bootable flash drive through the console utility diskpart is a fast and affordable way. Due to the fact that this utility works in text mode, every personal computer user can easily cope with this task.

With the rapid development of technology, everyone has access to the Internet, where you can find free versions of various programs for creating a bootable flash drive. However, it also happens that there is no access to the Internet due to some circumstances, so it is important to know a few simple alternative ways to create a bootable flash drive.

One of them is the described method using the command line. This manual method will be useful to every PC user. This console utility is included in the list standard programs. There is no need to additionally search for and install any other programs to configure a bootable flash drive. After ten minutes of using diskpart, a bootable USB flash drive with the Windows installation file is ready.

Preparing a flash drive using diskpart

Diskpart is a console system program included in Windows, through which you can manage disks, partitions and volumes by directly entering commands.

Creating a bootable flash drive using the command line will be shown clearly. The Windows 8 operating system will be used as an example. On other versions of the Windows operating system, such as Windows 7 or Windows 10, the creation process will be identical.

Before starting work you must connect a portable disk or flash drive, or other removable media to your computer. Such a device will be further referred to as a flash drive.

Then press the Win + X key combination or right-click in the lower left corner of the screen. For those who still know what this Win button is, we remind you:

Select menu item " Command Line (Administrator)».

If it is more convenient for you to call the window “ Execute"using Win + R, you can do this by entering in the window that opens " cmd" and clicking OK. These actions will lead to a similar result.

In the window that opens, type diskpart and press the Enter key.

Of course, it is more likely that the need to create a flash drive will not arise from the operating system, where there are simpler and more convenient methods, but from a clean command line when restarting the PC.

After this, you need to enter the data in the same way as shown in the picture below. After each command entered, press the Enter key.

  • list disk– a list of available disks will be displayed;
  • select disk #– instead of #, enter the number of the disk that is a flash drive, it will be bootable (in the example, this is disk number 1); It is easy to distinguish a flash drive from other disks by its size;
  • clean– the disk will be cleaned, all previous information will be deleted
  • create partition primary– a special section is created
  • active– the section is activated
  • format fs=ntfs quick– the disk will be formatted
  • assign– the disk name will be assigned and the connection point will be assigned
  • exit– the operation is completed. This will exit the command line.

The first stage of creating a bootable flash drive is complete.

Copying files to a flash drive

The next stage will be copying installation files programs on a flash drive. You need to copy all files in their entirety with their entire structure and directories.

This can be done using standard Windows tools such as Explorer. If, for various possible reasons, you want to do this using the same command line, then the following commands will help you with this:

  • Improved copy command " robocopy", unlike the legacy "copy", can copy subfolders with all their contents. The first argument of the command is the path to the files to be copied, and the second is the path to the folder into which the files will be copied. To copy subfolders you need to add a third argument " /E", otherwise only the files will be copied. For example, to copy all the files from drive f to a flash drive named g: you need to enter the command: robocopy f:\ g:\ /E
  • Deprecated file copy command " copy", using which you can copy only files (folders will have to be created manually with the "md" command). The first argument of the command is the path to the files to be copied, and the second is the path to the folder into which the files will be copied. To make it clear to the command that you want to copy not just one file in a folder, but all files, specify the code “*.*” as the file name.
  • The disk change command, the format of which is: DISK: . Those. to go to drive “D:\” you need to enter the following command: d:
  • To select a directory located in the current folder, enter CD <имя директории>eg: cd win10
  • To go to the top level of the file hierarchy, type cd \
  • To go to the parent folder, write cd ..
  • To view a list of files in the current folder, enter the command dir
  • To create a folder, run the command md <имя папки>

Knowledge of these commands is enough to successfully copy files to a flash drive.

This is what it will look like if you copy installation files located on the d:\win10 drive and a flash drive named “G:\”. Preparation and launch robocopy:

After a certain time, all files will be successfully copied:

Most often, a bootable flash drive is used to install or reinstall an operating system. If you don't have a disk drive, you can use a virtual DVD drive and an image file.

When installing an operating system from a bootable flash drive, you need to change the settings in the BIOS so that the computer boots through this device.

Video on the topic

Today I want to talk about one very convenient thing - this is a bootable (installation) USB flash drive for Windows (XP, Vista, 7 or even 8). It happens that you need to reinstall Windows on a netbook that does not have a disk drive, or on a computer or laptop with a non-working DVD drive, then installation flash drives come to the rescue. Using an example, I will show 3 ways to create such Bootable USB flash drive with Windows.

As I said above, an installation flash drive is an irreplaceable thing when it is not possible to reinstall Windows from a disk. Making an installation/bootable USB flash drive is quite simple, but I’ll tell you about the three simplest and best methods. Or rather, there are only two ways, the first is using the Windows command line (cmd), and the second using utilities - And . If using the second utility you can make an installation flash drive (and even a disk) only for Windows 7, then using UltraISO and the standard command line method you can make any one.

In order to create a bootable USB flash drive, you need to have an ISO image of the operating system (to create using utilities) or simply all the files copied from the installation disk (to create with cmd).

Creating a bootable Windows USB flash drive with CMD.

The process of creating a bootable USB flash drive using the command line will not take much time and it consists of only 9 steps. First, you need to run the command line (cmd) as an administrator and, of course, insert a flash card into the computer (at least 4 GB for a standard system image). Next, using the console utility "DiskPart" we will create a bootable USB flash drive:

1. Enter the command: and press Enter. [ After entering each command, you need to confirm its execution by pressing Enter.]

3. Now a list of all disks under the numbers will appear, in my example the flash drive is under the number 3, which means that to select it you need to enter the command: (if your flash drive is under a different number, for example 2, then you need to enter: select disk 2 )

4. Now after selecting the flash drive, you need to clean it using the command: clean

6. Now you need to select the created partition; to do this, run the command:

7. You need to activate the selected section using the command:

8. Now using the command: format the flash drive into the NTFS file system. Formatting does not happen quickly, so be a little patient

9. Well, after the formatting is complete, all you have to do is exit DiskPart mode using the command: Exit

That's all, the main work is done, now all that remains is to copy all the files from the boot disk or unzipped ISO image of the operating system to a USB device. All Windows 7 files on the installation disk will look something like this:

They just need to be copied and pasted onto a ready-made flash drive, which we have just configured correctly and made bootable from it.

As you can see, there is nothing complicated here; a bootable flash drive can be made for any operating system, be it Windows XP, Vista, 7 or even Windows 8.

Creating a bootable USB flash drive using the UltraISO utility.

With this utility, making a bootable USB flash drive is just as easy; for this you need an ISO image of the system and a flash drive of at least 4 GB. First, download UltraISO and install it on your computer. (The trial version is for 30 days, but this is enough if you don’t need to make bootable USB flash drives that often). Afterwards, launch the utility and select a trial period.

After launch, go to: “File -> Open” and specify the operating system image from which you want to make an installation flash drive.

Now, you need to burn this image to a flash drive, insert it into your computer if you have not already done so and go to the menu.

Next, a window will open in which you first need to select your flash drive in the “Disk Drive” item, then click “Format”. Afterwards, in the “Recording method” select “USB-HDD+” and click “Record”.

That's all, you just need to wait a little and a bootable Windows flash drive with UltraIso utility, from the installation disk image is ready.

You can also make an installation USB flash drive with Windows using the utility - "Windows 7 USB/DVD Download Tool". After the utility has been downloaded and launched, follow a few simple steps:

  1. Click "Browse" and select the Windows 7 ISO image and click "Next".
  2. Select "USB device" (if you need to make a bootable USB flash drive) or DVD (if you want to make a bootable DVD).
  3. Click "Begin copying" after selecting the desired media to creating an installation flash drive or disk.

All. Wait a little, the execution process will be completed and Bootable/installation USB flash drive with Windows 7 ready. That’s all, I think most will choose the option of creating with UltraIso, because with this utility you don’t need to do anything extra, just specify the iso image of the operating system that needs to be written to a flash drive, but the main disadvantage is that the utility is paid, and the trial version is only 30 days , so I think the best option is still the command line, you can learn these few commands and bootable flash drives can be made at any time.

P.S. If you have any questions about creating a bootable USB flash drive, please ask.

For various tasks that users face, for example, the need to create a bootable flash drive or there are problems with formatting a flash drive using standard tools from Explorer, there is a need to format a flash drive using the command line. Formatting a flash drive via the command line can be done in several ways.

In order to open the command line, launch the Start menu and enter the cmd command in the search bar.

In the command line window that appears, enter: format /fs:NTFS H: /q – where:

  • format – formatting task;
  • fs:NTFS – description of the file system we choose;
  • H: - the drive we need;
  • /q - command for quick formatting.

In the event that we want to format the file system in Fat or Fat32, the command will look like this: format /FS:FAT32 H: /q.

After entering the command, the message will be displayed: “Insert a new disk into drive H: and press the ENTER key...” - press ENTER.

Then the command line window displays: “Volume label (11 characters, ENTER - no label needed)” -

so click on ENTER.

Our flash drive is formatted.

Format command (second method)

Call the command line as described in paragraph one.

In the command line window that appears, type: format H: /fs:NTFS /v:Arhiv – where:

  • format – disk formatting task;
  • fs:NTFS – description of the file systems we choose;
  • v:Arhiv – the label of the drive we select (the name of your drive is entered).

Accordingly, when we choose another file system, after fs: we enter what we need - Fat or Fat32. The command looks like this: format H: /fs:FAT32 /v:Arhiv. If you want to select quick formatting, you need to add Q to the formatting command and the command will look like this: format H: /FS:NTFS /Q /v:arhiv.

Immediately after entering the command, a notification appears in the command line window: “Insert a new disk into drive H: and press the ENTER key...” - press the Enter key.

The flash drive is formatted.

Method 3: Built-in Diskpart utility

The Windows operating system has a built-in utility for working with drives, which allows us to format a flash drive.

Open the command line using the cmd command in the search bar of the Start menu.

In the command line window that appears, enter: diskpart and the utility for managing storage spaces will launch.

Type the command: list disk. This will allow us to see all the drives present on our computer. We find a flash drive that we are going to format by size. We began to see all the disks with an indication of their volumes. We remember the number of the disk we select, for example, 2.

Then we type the command: select disk 2, where 2 is the drive we select. Press Enter.

After this, the flash drive must be cleared of attributes, for which we enter the command: attributes disk clear readonly. After that, enter the command: clean.

After clearing the drive of attributes, we need to create a primary partition, for which we mark our disk in the file system of our choice:

First, enter the command: create partition primary, then set the file system we need with the command: format fs=ntfs or format fs=fat32. If quick formatting is necessary, then write the command as follows: format fs=NTFS QUICK or format fs=FAT32 QUICK. Click on Enter and the flash drive is formatted.

Exit the program using the command: exit.

Built-in Diskpart utility (another way)

There is another, slightly different way to format the drive using the built-in Diskpart program.

Open the command line window as described above, then enter the diskpart command and press Enter to launch the utility.

Then enter the command list disk and press Enter again. This way we will see all our drives. After this, just as in the previous method, we recognize our flash drive by size and remember the drive number. For example, 2.

We write the command: select disk 2, where 2 is the flash drive we select. Click on Enter.

Enter the command clean and press Enter - all files on the drive are deleted.

Next, you need to create a new partition on the flash drive, for which you enter the command: create partition primary and Enter, then the disk selection command: select disk 2 and Enter, where 2 is the drive we need. Then you need to enter the command: active so that the utility marks the partition as active. Then enter the command to mark up the file system: format fs=ntfs or format fs=fat32. As mentioned in the previous method, to quickly format, add QUICK to the command: format fs=NTFS QUICK or format fs=FAT32 QUICK.

After formatting is completed, you need to assign a letter to the flash drive. We do this using the command: assign, after which the drive autostarts, and we see an Explorer window on the screen with an already formatted flash drive.

To exit work in Diskpart, use the exit command.

Conclusion

As we showed in this article, formatting a flash drive via the command line is not difficult. The main thing is to carefully select the disk to format and remember that after formatting, your data may be lost forever. Working on the command line will help especially when working with the built-in Diskpart utility, if the flash drive cannot be formatted in a simple way from the Explorer menu, or when working with the flash drive you notice that part of the file system is not visible and the volume of the flash drive has decreased for some reason.

A complete guide to installing Windows 10 from a bootable USB flash drive. One of the main advantages of installing the Windows operating system from USB is the speed of installation, especially compared to the traditional method of installing Windows from DVD.

To create a bootable USB flash drive for Windows 10, we will use the previous version of the Windows operating system. This procedure should not take more than 10 minutes if done correctly.

What you will need:

  • For Windows 10 ISO or DVD for Windows 10
  • USB - with 4GB+ size
  • Working Windows 7/8/8.1 PC to create bootable USB

Important: Before you start creating a bootable Windows 10 disk or USB flash drive, check the version of Windows 7/8/8.1 for 32-bit or 64-bit. In simple words, you cannot use 32-bit Windows to create a bootable USB 64-bit Windows .

Read carefully:

  • It is not possible to create a 64-bit version of Windows 10 bootable USB on a PC running a 32-bit version of Windows.
  • You need a 64-bit version of Windows 7/8/8.1 to prepare a bootable USB in Windows 10 x64.
  • You you can create x86 version of Windows 10 bootable USB on a computer running x86 version of Windows 7/8/8.1

Installing windows 10

Step 1: Connect the USB drive to your Windows 7 or Windows 8 PC and transfer all your important data to a safe place as everything will be deleted from the drive during the process. We also suggest that you do not connect another external hard drive, or disable it if you have one, to avoid selecting the wrong drive when selecting a drive.

Step 2: Open a command prompt. To do this, you can enter CMD in the Start menu search or press the Ctrl + Shift + Enter keys simultaneously. Windows 7 users can also go to Start, All Programs, Accessories, right-click Command Prompt and select Run as Administrator. Click Yes when you see the UAC prompt to continue.

note that It is important to open the command prompt as administrator to avoid mistakes. Most of the users ignore this step and end up with errors while preparing a bootable USB flash drive. When you launch Command Prompt, you will see a UAC prompt where you need to click on the Yes button.

Step 3: At the command prompt, enter DISKPART, and then press Enter.

Now enter LIST DISK command and press Enter again to see all connected drives. This important step is to assign a drive number for your internal hard drive and your connected USB drive.

If you only have one internal hard drive or SSD, 1 will be the drive number of your USB drive. As you can see in the picture above, the disk number for my USB drive is 1.

Step 4: Type all the following commands one after another, and press the enter key after each command.

SELECT DISK 1

(IMP: In the above command, replace "1" with the disk number of your USB disk obtained in the previous step. Entering an incorrect disk number will result in data loss. So, please check the disk number before entering the disk number...)

(Press enter)

PURE

(Press enter)

CREATE primary partition

(Press enter)

SELECTING SECTION 1

(Press enter)

ACTIVE

(Press enter)

FS FORMAT = NTFS FAST

IMP: If your computer supports UEFI, please format the drive with FORMAT FS = FAT32 Quick teams.

(Press enter)

(Press enter)

EXIT

(Press enter)

Since we are not finished yet, please do not close the Command Prompt window. Just roll up and follow the instructions for the next step.

Step 5: If you are on Windows 8/8.1 and have an ISO image in Windows 10, right click on the ISO image and then click the Mount option to mount the ISO file.

And if you're on Windows 7, you can use Virtual CloneDrive. Select the drive after installing the ISO.

In this guide, we will assume "J" to be the drive letter of the virtual drive where you mounted the Windows 10 ISO.

And if you have a DVD in Windows 10, simply insert the DVD into the optical drive and note the optical drive letter. You can then use this drive letter as needed.

Step 6: Open a command prompt window and run the following commands.

(Press enter)

Here "J" is the drive letter of your virtual drive containing the Windows 10 ISO or DVD containing the installation files.

CD BOOT and press ENTER.

Step 7: Finally, enter the following command:

Bootsect.exe/NT60K:

In the above command, replace "K" with the drive letter of your USB drive that you are making bootable.

Once you see the "Bootcode was successfully updated on all target volumes" message, simply close the Command Prompt window. We're almost done!

Step 8: Finally, copy the entire contents of your Windows 10 ISO image to the root directory of the USB drive. You can either extract the contents of the ISO file or copy files from the connected drive. The same procedure applies even if you have a DVD in Windows 10. You just need to copy all the files in the root directory of the USB drive.

Step 9: Now that you have a bootable USB in Windows 10, turn on the computer you want to install Windows 10 on, allow booting from USB, set the boot priority to boot from USB, and then restart your computer again to begin installing Windows 10. Follow very simple on-screen instructions to complete the installation.

Enjoy the latest version of the Windows 10 operating system

In this lesson I will teach you how to make a bootable Windows USB flash drive via the command line without third-party programs.

Bootable Windows USB flash drive is a flash drive from which you can boot before starting the operating system.

This flash drive has many uses. For example, this may be needed when you want to install or restore an operating system after an error or damage by a virus, check or format a hard drive, test the OS when you do not have a DVD drive on your computer, etc. Agree that it is much more convenient to take a small device with you than to carry a disk. Also, the reading speed in this case is much faster than from an optical disk.

You can create a flash drive in many ways - standard tools, native or third-party programs. In this tutorial I will tell you how to do this using the command line. We will need a removable disk, i.e. A flash drive that needs to be connected to the computer. We also need the command line. There are several ways to launch it. If you have Windows 8, you can click “Start”, and then in the upper right corner in the search enter the name “Command Prompt”.

If you have Windows 7 or lower, then you can do this through the “Run” command, by the way, I talk about it in. It can be launched via the Start menu or the keyboard shortcut "Win+R". Next, enter the command “cmd” in the field and click “OK”.

We start the command line, in which we will now work. We will enter commands that will ultimately lead us to a bootable flash drive. The figure below shows a ready-made list of commands. Below the screenshot you will find a description of each step that will need to be taken.

Let's look at everything in order as we entered the commands:

diskpart- launching the program - text mode command interpreter. It allows you to manage objects (disks, partitions or volumes) by entering commands from the command line;

list disk- show a list of disks that are connected to the computer;

select disk 1- select the disk that we have as number 1. If you look at the list of disks, then by its size you can understand that it is the removable media that we need;

clean- delete all data from the flash drive;

create partition primary- create a primary partition;

select partition 1- select the section that you just created;

active- make the selected section active;

format fs=NTFS- The next step is formatting. Specify the file system "NTFS";

assign letter=Z- an optional item that allows you to assign a letter to the carrier;

Exit- at the final step, exit the Diskpart program.

Congratulations, the bootable USB flash drive has been successfully created. Now we transfer the files with the operating system to it. Files must be transferred in unpacked form, and not a disk image in *.iso format.

Now, in order, for example, to install Windows, we just need to set the BIOS to boot from a flash drive, i.e. so that the computer boots from removable media first, rather than from the hard drive.

In the following lessons we will look at how you can create a bootable USB flash drive using a third-party program and a program from Microsoft.

Below you can watch the video version of the lesson and find out how to create a bootable USB flash drive.

Everyone is used to having computer folders open in the same window in which we work. But there are times when folders start opening in a new window every time. This may occur due to an error or when we installed it ourselves. Now I’ll try to show how you can remove this bunch of windows.

In this lesson, we will walk you through the process of completely deleting files from your computer, as well as the issue of restoring previously deleted files from the Recycle Bin.