A Brief Discussion on Maintaining Windows on ARM Using Pure Commands
A Brief Guide to Maintaining Windows on ARM Using Only Command Line
As Windows on ARM devices become increasingly common, we may find ourselves at a loss when encountering ARM-based systems during maintenance. Without a PE environment or practical software that runs on ARM, how can we perform basic operations like reinstalling the system or partitioning the disk? This article will provide you with a relatively universal solution.
Required Materials
The materials needed to install Windows on ARM are similar to those for a standard Windows installation.
- A Windows image
- An independent system environment (PE)
- A tool for installing the image
Where to Get the Windows Image
Typically, we use Windows on ARM on OEM-customized ARM devices. In such cases, the computer’s disk contains a hidden partition that stores the OEM-customized system image package. We can use this system image package to perform a clean installation.
Where to Get the PE
Currently, there is no readily available PE system suitable for the ARM instruction set on the internet. However, thanks to Microsoft’s own Windows RE, we can use Windows RE as a PE system.
Where to Get the Tool for Installing the Image
Since there are very few tools compatible with the ARM architecture, it’s best to use only Microsoft’s official tools to ensure compatibility and stability. This article will introduce two tools, diskpart and dism, for maintaining Windows systems.
How to Enter the Windows RE System
There are several ways to enter Windows RE:
- If Windows can boot normally, hold down the Shift key while clicking Restart to enter Windows RE.
- If Windows fails to start, press F8 repeatedly during boot to enter Windows RE.
- If you force a power-off and restart three times while the Windows logo is displayed, the system will enter Windows RE on the next boot.
Reinstalling Windows on ARM in Windows RE
The reinstallation method described in this article assumes that Windows cannot boot, and we will install the system from within Windows RE. If Windows can boot normally, the same method can be used from within the normal Windows environment, but the steps will be simpler.
- First, enter the Windows RE system.
- Click Advanced Options → Command Prompt.
- Enter the
cmdcommand prompt interface.
Now, we need to determine a few things:
- In Windows RE, which drive is the original system drive?
- In Windows RE, which partition contains the OEM-customized image?
- What preparatory steps are needed before installing the system?
In Windows RE, Which Drive Is the Original System Drive?
We can use the diskpart tool to manage disk partitions.
In cmd, type diskpart and press Enter to enter the diskpart environment.
Enter the following commands:
list disk
Thecmdwindow will display all disks connected to the computer.select disk 0
Select the disk with index 0 (if only one disk is connected, it will be disk 0).list volcmdwill list all partitions on disk 0, including hidden partitions and those with drive letters.
At this point, based on the partition size and label, you can identify which partition is the Windows system drive—the one you will need to format and install the system onto. Remember the drive letter of this partition.
In Windows RE, Which Partition Contains the OEM-Customized Image?
Again, you can identify this partition by its size and label. However, it may not have a label, so some trial and error may be required. Typically, this partition is about 20 GB in size, enough to hold a system image.
Once you’ve identified an OEM partition, you need to assign it a drive letter. Here’s how to do that using diskpart:
- After running the
list volcommand, each partition will have an index number. Select the index of the partition you want to assign a drive letter to. - Enter
select vol x(wherexis the index of the selected partition). - Enter
assign letter=Z.
This will mount the partition as drive Z:.
What Preparatory Steps Are Needed Before Installing the System?
Two things:
- File backup
- Driver backup (optional)
File Backup
Since Windows RE does not have a File Explorer, we need to work around this by using another application to open a file browser. We can use Notepad for this purpose.
In cmd, type notepad.exe and press Enter to open Notepad.
Click File → Open in the top-right corner of Notepad to open the file selection dialog of File Explorer.
In the file type dropdown at the bottom right, select All Files (*.*), and you will be able to browse all files on the computer. You can then find the files you need and copy them to a non-system drive.
Driver Backup (Optional)
If you are using the original Windows image provided by the OEM, you can skip the driver backup, as the image already contains the necessary drivers. If you are using a generic Windows ARM image, you can use the dism tool to back up the drivers to a non-system drive, ensuring a smooth installation.
The command to back up drivers using dism is:
dism /image:C:\ /export-driver /destination:D:\000
In the command above,
C:\is the drive letter of the Windows system drive, andD:\000is the location for the driver backup. Adjust these paths according to your situation.
Starting the Windows Reinstallation
Once all preparations are complete, you can begin reinstalling Windows.
First, format the system drive:
format C: /FS:NTFS /Q /Y
In the command above,
Cis the drive letter of the system partition. Replace it with the actual drive letter.
Data is priceless—proceed with caution when formatting!
Next, use the dism command to apply the system image to the formatted partition:
dism /Apply-Image /ImageFile:"Z:\install.wim" /index:1 /ApplyDir:C:\
In the command above,
Z:\install.wimshould be replaced with the actual path and filename of your OEM image, andApplyDir:C:\should be replaced with the drive letter of the partition where you want to install the system.
Wait for the operation to complete.
After applying the image, you need to create and configure the boot files for the new system to ensure it can boot successfully.
Use the following command to create the boot configuration:
bcdboot C:\Windows /s K: /f UEFI
In the command above,
C:\is the partition where the new system is installed, andKis the drive letter of the EFI partition.
Note: Typically, the EFI partition does not have a drive letter and needs to be assigned manually. The method is the same as assigning a drive letter to the OEM image partition: select the partition index and enter
assign letter=K.
The EFI partition is usually a FAT32 file system, ranging from 100 MB to 500 MB in size, with the partition type set to EFI or ESP. Use these clues to identify which partition is the EFI partition.
If you are using a generic Windows ARM system image, it is recommended to inject the previously backed-up drivers into the new system at this point. Use the following
dismcommand:
dism /image:C:\ /Add-Driver /Driver:D:\000 /REcurse
In the command above,
C:\is the drive letter of the new system partition, andD:\000is the folder containing the driver backup. Adjust these paths according to your situation.
At this point, we have installed the Windows system and configured the boot environment for it. Restart the computer, and you will be able to boot into the newly installed Windows system.
In the next article, we will discuss how to use third-party tools to maintain and install Windows on ARM.