How come these commands displayed errors and what commands should work without errors?
Error: 87
Error: 1639
X:\windows\system32>diskpart
Microsoft DiskPart version 10.0.19041.1
Copyright (C) Microsoft Corporation.
On computer: MININT-P6MKHHP
DISKPART> lis dis
Disk ### Status Size Free Dyn Gpt
Disk 0 Online 698 GB 0 B
Disk 1 Online 58 GB 26 GB
DISKPART> sel dis 0
Disk 0 is now the selected disk.
DISKPART> lis vol
Volume ### Ltr Label Fs Type Size Status Info
Volume 0 H DVD-ROM 0 B No Media
Volume 1 C System Rese NTFS Partition 499 MB Healthy
Volume 2 E Windows NTFS Partition 689 GB Healthy
Volume 3 F HP_TOOLS FAT32 Partition 2056 MB Healthy
Volume 4 D ESD-USB FAT32 Removable 32 GB Healthy
Volume 5 G Recovery NTFS Partition 7148 MB Healthy Hidden
DISKPART> exit
Leaving DiskPart...
X:\windows\system32>sfc /scannow /offbootdir=c:\ /offwindir=e:\windows
Beginning system scan. This process will take some time.
Windows Resource Protection did not find any integrity violations.
X:\windows\system32>dism /image:e:\ /cleanup-image /restorehealth
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
Image Version: 10.0.19042.844
The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior.
Use the /ScratchDir option to point to a folder with sufficient scratch space. The recommended size is at least 1024 MB.
[==========================100.0%==========================]
Error: 0x800f081f
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see https://go.microsoft.com/fwlink/?LinkId=243077.
The DISM log file can be found at X:\windows\Logs\DISM\dism.log
X:\windows\system32>md e:\scratchdir
X:\windows\system32>dism /image:e:\windows /scratchdir /cleanup-image /restorehealth /source:esd:D:\sources\install.esd:6 /limitaccess
Error: 87
The /scratchdir option is missing a required argument.
For more information, refer to the help by running DISM /scratchdir /?.
The DISM log file can be found at X:\windows\Logs\DISM\dism.log
X:\windows\system32>dism /scratchdir /?
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
/ScratchDir:<path_to_directory>
Specifies a temporary directory to be used for extracting files for
servicing. The directory must exist.
If not set, the temporary directory will be used.
Example:
DISM.exe /Image:C:\test\offline /scratchdir:D:\Scratch
X:\windows\system32>dism /image:e:\test\offline /scratchdir:e:\scratch
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
Error: 1639
The command-line is missing a required servicing command.
For more information, refer to the help by running DISM.exe /Image=<path_to_offline_image> /? where <path_to_the_offline_image> is the full path to an offline Windows image.
The DISM log file can be found at X:\windows\Logs\DISM\dism.log
X:\Sources>dism /image:e:\ /scratchdir: e:\windows\temp /cleanup-image /restorehealth
Error: 87
The /scratchdir: option is missing a required argument.
For more information, refer to the help for the /scratchdir: option.
X:\Sources>dism /image:e: /cleanup-image /restorehealth
Deployment Image Servicing and Management tool
Version: 10.0.19041.572
Image Version: 10.0.19042.844
The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior.
Use the /ScratchDir option to point to a folder with sufficient scratch space. The recommended size is at least 1024 MB.
[===========================84.9%================= ]
[===========================85.2%================= ]
[===========================85.7%================= ]
[===========================86.1%================= ]
[===========================86.6%================== ]
[===========================87.0%================== ]
[===========================87.5%================== ]
[===========================87.9%================== ]
[===========================88.4%=================== ]
[===========================88.8%=================== ]
[===========================89.3%=================== ]
[===========================89.7%==================== ]
[===========================90.2%==================== ]
[===========================90.6%==================== ]
[===========================91.1%==================== ]
[===========================91.5%===================== ]
[===========================92.0%===================== ]
[==========================100.0%==========================]
Error: 0x800f081f
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see https://go.microsoft.com/fwlink/?LinkId=243077.
The computer can boot to Windows RE > command prompt
or
The computer can boot to a winndows 10 iso > Windows RE > command prompt
Please provide commands to use scratch that do not display errors when running dism restorehealth.
For the iso: esd:6