1

I want to install UWF feature through DISM in Windows 10. This works! However, I need to do this several times so I have the DISM command in a batch file. When the DISM command succeeds, it asks if I want to reboot. How can I feed (pipe) an answer? The following does NOT work:

echo n | DISM /online /Enable-Feature...

How can I accomplish this so that reboot question is automatically answered with n (No)?

Thanks

Zavulon
  • 121
  • 8
  • [This page](https://learn.microsoft.com/en-gb/windows-hardware/manufacture/desktop/what-is-dism) talks of "answer files" ... no idea if that will help. – TripeHound Nov 09 '18 at 09:57
  • This seems like a dead end for me, you can only generate an "answer file" with the W10 ADK and a W10 WIM file. I installed the ADK, but I can't seem to get a WIM file. I have no official W10 source since the devices I want to adjust are 3rd party with W10 pre-installed. – Zavulon Nov 12 '18 at 07:55

2 Answers2

1

You can run DISM /? to show the documentation page for Deployment Image Servicing and Management tool (DISM).

You'll see a section in the documentation titled DISM OPTIONS:

DISM OPTIONS:

  /English                - Displays command line output in English.
  /Format                 - Specifies the report output format.
  /WinDir                 - Specifies the path to the Windows directory.
  /SysDriveDir            - Specifies the path to the system-loader file named
                            BootMgr.
  /LogPath                - Specifies the logfile path.
  /LogLevel               - Specifies the output level shown in the log (1-4).
  /NoRestart              - Suppresses automatic reboots and reboot prompts.
  /Quiet                  - Suppresses all output except for error messages.
  /ScratchDir             - Specifies the path to a scratch directory.

This section details the /NoRestart option which is what you are looking for.

You can apply it to your script like the following...

DISM /online /Enable-Feature... /NoRestart
Zam
  • 1,121
  • 10
  • 27
0

Apparantly, there is an undocumented switch /norestart that just does what I want, I append it to the back of the command:

DISM /online /Enable-Feature... /norestart

I found this while checking the powershell version of the DISM command.

Zavulon
  • 121
  • 8
  • 1
    `dism /?` shows this option - so I won't call it "undocumented". – Stephan Nov 27 '18 at 10:42
  • @Stephan agreed - I wrote a new answer that documents the documentation since the edit queue is full for this question and will probably never be looked at. – Zam Apr 23 '21 at 14:40