Skip to main content

Run DISM and SFC Scan

Summary

This script is used to execute the DISM and SFC commands on the endpoint. Running the script does not guarantee resolution of any corrupted system files.

Task Creation

Create a new Script Editor style script in the system to implement this task.

Task Creation Image 1

Task Creation Image 2

Name: Run DISM and SFC Scan Description: This script is used to execute the DISM and SFC commands on the endpoint. Running the script does not guarantee resolution of any corrupted system files.
Category: Patching

Task Creation Image 3

Task

Navigate to the Script Editor section and start by adding a row. You can do this by clicking the Add Row button at the bottom of the script page.

Task Creation Image 4

A blank function will appear.

Task Creation Image 5

Row 1 Function: Command Prompt Script

Search and select the Command Prompt (CMD) Script function.

Task Creation Image 6

The following function will pop up on the screen:

Task Creation Image 7

Paste in the following Command Prompt script and set the Expected time of script execution in seconds to 600 seconds. Click the Save button.

DISM.exe /Online /Cleanup-image /Restorehealth

Task Creation Image 8

Row 2 Function: Script Log

Add a new row by clicking the Add Row button.

Task Creation Image 9

A blank function will appear.

Task Creation Image 5

Search and select the Script Log function.

Task Creation Image 10

The following function will pop up on the screen:

Task Creation Image 11

In the script log message, simply type %Output% and click the Save button.

Task Creation Image 12

Row 3 Function: Command Prompt Script

Search and select the Command Prompt (CMD) Script function.

Task Creation Image 6

The following function will pop up on the screen:

Task Creation Image 7

Paste in the following Command Prompt script and set the Expected time of script execution in seconds to 600 seconds. Click the Save button.

sfc /scannow

Task Creation Image 13

Row 4 Function: Script Log

Add a new row by clicking the Add Row button.

Task Creation Image 9

A blank function will appear.

Task Creation Image 5

Search and select the Script Log function.

Task Creation Image 10

The following function will pop up on the screen:

Task Creation Image 11

In the script log message, simply type %Output% and click the Save button.

Task Creation Image 12

Click the Save button at the top-right corner of the screen to save the script.

Task Creation Image 14

Completed Task

Task Creation Image 15

Output

  • Script log