locked
Handling Restart confirmation Prompt in DISM /online /enable-feature RRS feed

  • Question

  • Hello People,

    I need your help related with handling reboot confirmation prompt post enabling feature using DISM. Below is the command:
    dism /online /enable-feature /featurename netfx2 /All

    One running above command as part of one of the batch script output looks like this:

    #########################################################

    C:\test> dism /online /enable-feature /featurename:netfx3 /All

    Deployment Image Servicing and Management Tool
    Version: 6.3.9600.17031

    Image Version: 6.3.9600.17031

    Enabling feature(s)

    [===================100.0%======================]

    The operation completed successfully.

    Restart Windows to complete this operation.

    Do you want to restart the computer now? <Y/N>

    #############################################################

    I want to handle above confirmation prompt automatically in the script by choosing Y.

    I tried with below command but realized later that its not going help:

    echo Y | dism /online /enable-feature /featurename netfx2 /All

    Any guidance how should this be handled, kindly help?

    Thanks,



    • Edited by San15 Wednesday, July 15, 2015 1:26 PM
    • Moved by Bill_Stewart Friday, August 14, 2015 8:05 PM Off-topic
    Wednesday, July 15, 2015 10:08 AM

Answers

  • Another easier option would be to use /NoRestart options while installing the feature. And at the end of your batch script(I assume you are accomplishing other tasks in your scripts) you can force the computer to restart with  shutdown /r /t 00 /f
    • Proposed as answer by jrv Wednesday, July 15, 2015 1:19 PM
    • Marked as answer by Bill_Stewart Friday, August 14, 2015 8:05 PM
    Wednesday, July 15, 2015 11:00 AM

All replies

  • You are posting in the wrong forum.  DISM is not a script.  Post issues about DISM in the deployment forum.


    \_(ツ)_/

    Wednesday, July 15, 2015 10:45 AM
  • Another easier option would be to use /NoRestart options while installing the feature. And at the end of your batch script(I assume you are accomplishing other tasks in your scripts) you can force the computer to restart with  shutdown /r /t 00 /f
    • Proposed as answer by jrv Wednesday, July 15, 2015 1:19 PM
    • Marked as answer by Bill_Stewart Friday, August 14, 2015 8:05 PM
    Wednesday, July 15, 2015 11:00 AM
  • Thanks jrv
    I posted it here as I am using DISM command in my script for getting certain updates and I am unable to handle the situation when it prompts for reboot. 
    Wednesday, July 15, 2015 1:16 PM
  • I do understand that you have a batch file.  Questions about specific utility programs like DISM at better answered in the forums specific to that subsystem.  Yours was specific and you did get an answer here.  I just wanted too note that looking at and searching the product forum can be a faster way to find an answer.

    Suppressing the reboot seems to be the best answer and you did get it here.


    \_(ツ)_/

    Wednesday, July 15, 2015 1:19 PM