question

Docs-4663 avatar image
0 Votes"
Docs-4663 asked Docs-4663 edited

Scratch directory commands in windows RE for dism restorehealth that do not display errors

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

windows-10-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Try amend your second command to the following and see if it works or not:

 dism /image:e:\windows /scratchdir:e:\scratchdir /cleanup-image /restorehealth /source:esd:D:\sources\install.esd:6 /limitaccess

"/scratchdir" don't expect space between itself and the folder path.

0 Votes 0 ·
Docs-4663 avatar image
0 Votes"
Docs-4663 answered cheong00 commented

This is the result to the earlier reply by cheong00


Error: 267


Microsoft Windows [Version 10.0.19042.964]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>dism /image:e:\windows /scratchdir:e:\scratchdir /cleanup-image /restorehealth /source:esd:D:\sources\install.esd:6 /limitaccess

Deployment Image Servicing and Management tool
Version: 10.0.19041.844


Error: 267

An error occurred while accessing the temporary directory.
Ensure that the path to the directory exists and that you have Read/Write permissions on the folder. For more information, refer to the help by running DISM.exe /ScratchDir /?.

C:\WINDOWS\system32>

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

"net helpmsg 267" said "The directory name is invalid". Make sure that the folder pointed to "TEMP" environment variable exists and you have write access.

In your case you may want to change it to somewhere on E drive too.

0 Votes 0 ·
Miles-MSFT avatar image
0 Votes"
Miles-MSFT answered

Hi

For deep research on DISM , you could open a request ticket with Microsoft support. https://support.serviceshub.microsoft.com/supportforbusiness

Best Regards

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Docs-4663 avatar image
0 Votes"
Docs-4663 answered Miles-MSFT commented

There are many end users that develop boot problems related to windows updates or integrity violations detected by using scannow.

Troubleshooting can be performed in Windows Recovery Environment (RE).

Two DISM commands that can be run in Windows RE are:

Restorehealth

Revertpendingactions

Each of these may require scratch.

Does anybody know how to use scratch in Windows RE?

dism /image:D:\ /cleanup-image /revertpendingactions
dism /image:D:\ /cleanup-image /restorehealth

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.




@Miles-MSFT
These basic questions on using scratch should not require a business ticket as they are to help non-business end users.





How do you run dism commands in windows RE so that there are no error messages / codes?

Error: 87
Error: 1639
Error: 267

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Unfortunatelty, our current conditions could not reappear this problem .
We suggest you open a request ticket with microsoft support for further assiatance https://serviceshub.microsoft.com/supportforbusiness

0 Votes 0 ·

Today I'd submitted an entry for call back and waited 19 minutes.
The individual answering the telephone was not familiar with https://docs.microsoft.com/en-us/answers/products/ > https://docs.microsoft.com/en-us/answers/index.html
Then the call was disconnected.
There was no call back.
It was a bad experience.

The question was not yet answered:

How to run dism commands in windows RE using scratch so that there is no error?
restorehealth

0 Votes 0 ·

You could use this web https://serviceshub.microsoft.com/supportforbusiness to contact with microsoft service support .
Firstly please login and provide your contact information.
A verification email will be sent to the preferred email address provided.
Then please check your email after we finish to complete this verification.
Our technical engineer will establish contact with you as soon as possible after getting your suppport request.

Best Regards

0 Votes 0 ·
Show more comments
Docs-4663 avatar image
0 Votes"
Docs-4663 answered Docs-4663 edited

So for this thread I'm not seeking pay support.


On this website I provide free support.


This was my first question.


I'm seeking free support.


If somebody can find the answer(s) for Windows RE they may be useful in many threads.

For example: How to run DISM commands in windows RE so that there are no scratch error messages and / or codes.


For each:

restorehealth
revertpendingactions

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you ever get the information that you needed?

0 Votes 0 ·

I've not yet seen any new information or links.

0 Votes 0 ·