Seeking the quickest way to generate an image for re-installation

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 7
    Windows 10
    Thread Starter
       #11

    hsehestedt, that is so great! Ultimately I am most disposed towards the types of solutions that you indicate you prefer yourself - outside of (perhaps) eliminating Cortana and onedrive and a couple of other extraneous / intrusive / resource-intensive services, I am less invested in "de-bloating" than in being able to quickly get my system back to a "like new" state with an unattended install. Years ago I generated some very simple batch files for alternative startup routines - but this was back in the day's of Windows 3.1! I would love whatever assistance and guidance you could provide, and I could not appreciate it any more!

    Thank you so much!
      My Computer


  2. Posts : 4,188
    Windows 11 Pro, 22H2
       #12

    I have a question: Are you familiar with creating VMs at all, either using Hyper-V included with Windows 10 or 11 Pro or using something like VMware? I ask simply because creating a VM is a perfect way to do some testing of your unattended installation. Of course, if you have a physical machine that you don't mind using for testing purposes, we can certainly use that instead.

    So, here is what I propose:

    Start by glancing through Kari's tutorial that I linked to in post #10 of this thread. Then, I'll send to you some simple instructions on how to modify Kari's procedure to just do a plain unattended installation without the need for setting up any reference system. That would be a great place to start. Does that sound good to you? This way we start simple, and we can build upon that.

    NOTE: I'm a bit tied up for today so it will probably be this evening before I can send you those directions.

    Let me know if this sounds good to you. If not, just let me know what you prefer to do, and I will gladly help.

    I may not know how to do absolutely everything, but there is a great deal that I do know so I certainly help you get pretty far down this rabbit hole .
      My Computers


  3. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #13

    Hello @hsehestedt,

    hsehestedt said:
    I used to go with the customized Windows image, but it was simply too much of a hassle to maintain for me.
    I too used to do it that way [ Vista, Win 7, Win 10 initially ] and also found that it was too cumbersome and time consuming, even if I did NOT make any mistakes on the first attempt.

    hsehestedt said:
    2) You could create a standard unattended setup file but without the need to create a reference system. Then, once Windows is installed, you could simply run a script or batch file that applies all your customizations.

    My Personal Preference

    So now I use method 2 above. I have a single batch file that applies all sorts of customizations, and I can easily comment out any modifications I don't want on a specific machine. Much easier than having a different custom image for each system!

    If you have any interest in seeing what it is that I am doing, please let me know and I'll post my batch file here for you. You can simply use it as a reference to get an idea of what I do and maybe save time for you if you want to do some of the same customizations.
    I would be interested please.

    Thank you.
      My Computer


  4. Posts : 7
    Windows 10
    Thread Starter
       #14

    Hi hsehestedt (and Paul Black too),

    I honestly do not have any experience with virtual machines - I have watched some videos on YouTube and have learned that hyper v is a component of windows 10 pro, but I only have the home addition. I will check out Kari's tutorial and follow up again later. Thank you so much, again and always!
      My Computer


  5. Posts : 4,188
    Windows 11 Pro, 22H2
       #15

    Sorry for the slow response. I'll put together a detailed response for both of you tomorrow (I promise!). I just got way more swamped than I had expected today.
      My Computers


  6. Posts : 4,188
    Windows 11 Pro, 22H2
       #16

    PART 1: Unattended Setup of Windows Without the Need for a Reference System

    This option will install Windows 100% automatically for you. All the questions that you would normally answer during Windows setup such as the language to use, the time zone, etc. will be automatically answered by the autounattend answer file that you are creating. However, this option will not customize Windows beyond that.

    For this option, begin by following the steps in Kari's tutorial. You can ignore any references to the reference machine because you will not need it.

    Continue following the steps in the tutorial up to and including step 3.18.

    Once you have completed step 3.18, skip to Part Four. This section will tell you to create a new answer file. DO NOT DO THIS! Instead, just keep adding the items listed there to the answer file you have already been working on.

    When you get to step 4.3 set all the items as shown in that step but DO NOT SET COPYPROFILE. Leave CopyProfile blank.

    Contine following the steps up to and including step 4.8.

    Go back to step 3.19 and continue to the end of section 3 to validate and save your answer file.

    That is all!

    Now, there are a lot of other refinements that we could perform, but let's get you started with this. Once you have this working, I can throw a lot more at you, but I presume that by then you will also have plenty of questions.

    PART 2: What I do to Automate Configuration After Initial Setup

    Once again, I'm going to hold some things back to keep from getting too confusing, but this is a good starting point.

    First, after new unattended installation, or even just a plain manual clean install, I like to get all the drivers for my system installed. To make this task SUPER EASY, here is what I do:

    1) Before I clean install on the system, I export all my drivers from the system. I'm assuming that you are starting off with all drivers installed on the system and that everything is working fine. To export drivers, run these commands from a command prompted run as Administrator:

    MD C:\Driver_Backup
    pnputil /export-driver * C:\Driver_Backup

    That's all! Now, just backup this folder to a safe place like a thumb drive, etc. so that you can access it after you reinstall Windows.

    2) After you clean install Windows, you can restore the drivers like this:

    Open Device Manager. At the top of the device tree you will see the name of your computer. Right-click it and then select "Add drivers". Point it to your backup of your drivers. Made sure the checkbox to include subdirectories is selected.

    This may take a few minutes and your screen may flash or go blank temporarily when the display driver is being installed. This is normal!

    Done! You just installed all your drivers the easy way.

    Ok, this next piece is a big one for me. The batch file below automates all kinds of tasks that I typically would have to setup manually after an install. Note that I have commented the heck out of things becaue otherwise I will forget what everything does . But, that should also help you to follow what is happening.

    Note: This is actually a "simplified" version. There is actually a lot more that you could do, but let let's not go overboard on the first outing, okay?

    The main idea is that you can go through this and sort of pick and choose what you like, or maybe it will give you ideas for other things you want to do.

    TIP: If you are going to modify this file, make a copy so that you alwys have the original to go back to.

    As always, please feel free to ask any questions at all. I would love to help.

    Code:
    @echo off
    
    cd /d %~dp0
    
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: This batch file will customize many settings within Windows following a clean install. For example, it will      ::
    :: turn off advertising that is displayed in a number of places within Windows. It will enable automatic hiding     ::
    :: of the taskbar, disable widgets, configure power settings, and much, much more.                                  ::
    ::                                                                                                                  ::
    :: About the comments in this batch file:                                                                           ::
    ::                                                                                                                  ::
    :: Throughout this batch file, in those places where an option can simply be turned on or off, you will note that   ::
    :: the setting is preseeded with a comment that says "Turn on" or "Turn off". There will also be another comment    ::
    :: prior to that that notes where in the GUI this group of settings can be found so that you can easily flip the    ::
    :: state from ON to OFF or from OFF to ON in the GUI, should you wish to do so. If a GUI setting for the option     ::
    :: does not exist, we will note how to alter the setting from a command line.                                       ::
    ::                                                                                                                  ::
    :: For some settings, rather that a "Turn on" or or "Turn off", you will find that the comments say "Enable" or     ::
    :: "Disable". In these cases, the provided command line not only turns an an option on or off, but it enables or    ::
    :: disables the GUI option as well. Where possible, we discribe how to reverse this from the command line as well.  ::
    ::                                                                                                                  ::
    :: There are many, many more settings that could be altered from a command line, but if you don't see a setting for ::
    :: something that you wish to alter here, this means that either I could not find a command line option to alter    ::
    :: that setting or that I wanted to keep the default setting for that option.                                       ::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: Check to see if this batch file is being run as Administrator. If it is not, then rerun the batch file ::
    :: automatically as admin and terminate the intial instance of the batch file.                            ::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    (Fsutil Dirty Query %SystemDrive%>Nul)||(PowerShell start """%~f0""" -verb RunAs & Exit /B) > NUL 2>&1
    
    ::::::::::::::::::::::::::::::::::::::::::::::::
    :: End Routine to check if being run as Admin ::
    ::::::::::::::::::::::::::::::::::::::::::::::::
    
    cls
    echo ***********************************
    echo * Applying Windows Customizations *
    echo ***********************************
    echo.
    echo Please be patient since this process may take a while...
    echo.
    
    REM      #########################
    REM      # Notification Settings #
    REM      #########################
    
    REM   ###########################################################
    REM   # The following settings can be found here:               #
    REM   # Settings > System > Notifications > Additional settings #
    REM   ###########################################################
    
    REM ***************************************************************
    REM * Turn Off: Show the Windows welcome experience after updates *
    REM * and when signed in to show what's new and suggested         *
    REM ***************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-310093Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *************************************************************
    REM * Turn Off: Suggest ways to get the most out of Windows and *
    REM * finish setting up this device                             *
    REM *************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" /v "ScoobeSystemSettingEnabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *********************************************************
    REM * Turn Off: Get tips and suggestions when using Windows *
    REM *********************************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM      #############################
    REM      # End Notification Settings #
    REM      #############################
    
    
    
    
    
    
    REM      ###########################
    REM      # Remote Desktop Settings #
    REM      ###########################
    
    REM *******************************************************
    REM * Turn On: Remote Desktop                             *
    REM * This setting can be found here:                     *
    REM * Settings > System > Remote Desktop > Remote Desktop *
    REM *******************************************************
    
    powershell "Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name 'fDenyTSConnections' -Value 0" > NUL
    powershell "Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'" > NUL
    
    REM As an alternative, the following command can be run in place of the second
    REM command above to enable the firewall rule for Remote Desktop:
    REM
    REM netsh advfirewall firewall set rule group="remote desktop" new enable=yes
    
    REM      ###############################
    REM      # End Remote Desktop Settings #
    REM      ###############################
    
    
    
    
    
    
    REM      ######################
    REM      # Clipboard Settings #
    REM      ######################
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # Settings > System > Clipboard             #
    REM   #############################################
    
    REM *****************************
    REM * Turn On: Clipboard history *
    REM *****************************
    
    REG ADD "HKCU\Software\Microsoft\Clipboard" /v "EnableClipboardHistory" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM      ##########################
    REM      # End Clipboard Settings #
    REM      ##########################
    
    
    
    
    
    REM      ###############################
    REM      # Network & Internet Settings #
    REM      ###############################
    
    REM   #############################################################################################################
    REM   # The following settings can be found here:                                                                 #
    REM   # Settings > Network & internet > Advanced network settings > Advanced sharing settings > Private networks  #
    REM   # NOTE: These settings will only be reflected in the GUI once the network is marked as a "Private" network. #
    REM   #############################################################################################################
    
    REM **************************************************
    REM * Turn On: Network discovery                     *
    REM * NOTE: This is for the Private network profile. *
    REM **************************************************
    
    PowerShell "Set-NetFirewallRule -DisplayGroup 'Network Discovery' -Enabled True -Profile Private"
    
    REM **************************************************
    REM * Turn On: File and Printer Sharing              *
    REM * NOTE: This is for the Private network profile. *
    REM **************************************************
    
    PowerShell "Set-NetFirewallRule -DisplayGroup 'File And Printer Sharing' -Enabled True -Profile Private"
    
    REM      ###############################
    REM      # End Network & Internet Settings #
    REM      ###############################
    
    
    
    
    
    
    REM      ############################
    REM      # Personalization Settings #
    REM      ############################
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # Settings > Personalization > Lock screen  #
    REM   #############################################
    
    REM **************************************************************************************
    REM * Turn Off: Get fun facts, tips, tricks, and more on your lock screen                *
    REM * NOTE: This option only shows up when when the lock screen is set to use a picture. *
    REM **************************************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "RotatingLockScreenOverlayEnabled" /t REG_DWORD /d 0x00000000 /f > NUL
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   ####################################################################################################
    REM   # The following setting can be found here (after applying the registry setting below):             #
    REM   # NOTE: Select "View by: Large icons" or "View by: Small icons" when you first open Control Panel. #
    REM   # Control Panel > All Control Panel Items > Power Options > Change plan settings >                 #
    REM   # Change advanced power settings > Display > Console lock display off timeout                      #
    REM   ####################################################################################################
    
    REM *************************************************************************************************
    REM * Allow lock screen timeout to be changed                                                       *
    REM *                                                                                               *
    REM * By default, the lockscreen times out and goes to a blank screen after one minute and no way   *
    REM * is provided in the Windows GUI to change this. After implementing this setting, the user will *
    REM * have access to a new setting in the Control Panel to change this timeout. This is especially  *
    REM * helpful if you want to be able to see a screensaver run while on the lockscreen.              *
    REM *                                                                                               *
    REM * The registry entry will expose the new option in Control Panel in the location noted above.   *
    REM * In addition, we will set the screen timeout values below both for when the system is locked   *
    REM * and unlocked as well as on AC power and battery power.                                        *
    REM *************************************************************************************************
    
    REM This registry entry enables the GUI setting noted above.
    
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7" /v "attributes" /t REG_DWORD /d 0x00000002 /f > NUL
    
    
    REM    ******************************
    REM    * Other Screensaver Settings *
    REM    ******************************
    
    REM ********************************************************************
    REM * The selected screensaver is saved to:                            *
    REM *                                                                  *
    REM * HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE as a REG_SZ *
    REM *                                                                  *
    REM * Example: C:\WINDOWS\system32\ssText3d.scr                        *
    REM *                                                                  *
    REM * To set no screensaver, delete the SCRNSAVE.EXE entry             *
    REM ********************************************************************
    
    REM *********************************************************
    REM * Set "On resume, display logon screen" to ON (checked) *
    REM * Set to "0" to uncheck this option                     *
    REM *********************************************************
    
    REG ADD "HKCU\Control Panel\Desktop" /v "ScreenSaverIsSecure" /t REG_SZ /d "1" /f > NUL
    
    REM ***************************************************
    REM * Set the Screen saver "Wait" time to 30 minutes. *
    REM * NOTE: This value is specified in seconds        *
    REM ***************************************************
    
    REG ADD "HKCU\Control Panel\Desktop" /v "ScreenSaveTimeOut" /t REG_SZ /d "1800" /f > NUL
    
    
    REM    ****************************
    REM    * Display Timeout Settings *
    REM    ****************************
    
    REM For the following 4 settings, the number at the end is the timeout in seconds. 0 = NEVER.
    
    REM Display Timeout when system is unlocked (on AC Power)
    powercfg.exe /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 600 > NUL
    
    REM Display Timeout when system is locked (on AC Power)
    powercfg.exe /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 3600 > NUL
    
    REM Display Timeout when system is unlocked (on Battery)
    powercfg.exe /setdcvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 300 > NUL
    
    REM Display Timeout when system is locked (on Battery)
    powercfg.exe /setdcvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 60 > NUL
    
    REM Make the scheme active
    powercfg.exe /setactive SCHEME_CURRENT > NUL
    
    REM ***********************************
    REM * End of Display Timeout Settings *
    REM ***********************************
    
    REM      #################
    REM      # PowerSettings #
    REM      #################
    
    
    REM On battery power, turn off my screen after 5 minutes
    powercfg -change -monitor-timeout-dc 5 > NUL
    
    REM On battery power, put my device to sleep after 15 minutes
    powercfg -change -standby-timeout-dc 15 > NUL
    
    REM * When plugged in, turn off my screen after *
    REM * 30 minutes                                *
    
    powercfg -change -monitor-timeout-ac 30 > NUL
    
    REM * When plugged in, put my device to sleep after *
    REM * NEVER                                         *
    
    powercfg -change -standby-timeout-ac 0 > NUL
    
    REM      #####################
    REM      # End PowerSettings #
    REM      #####################
    
    
    
    
    
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # Settings > Personalization > Start        #
    REM   #                                           #
    REM   # Enable only one of the following three    #
    REM   # options. Comment out the others. By       #
    REM   # default, we have "More pins" enabled.     #
    REM   #############################################
    
    REM **********************
    REM * Layout - More pins *
    REM **********************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_Layout" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ********************
    REM * Layout - Default *
    REM ********************
    
    REM REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_Layout" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *********************************
    REM * Layout - More recommendations *
    REM *********************************
    
    REM REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_Layout" /t REG_DWORD /d 0x00000002 /f > NUL
    
    REM *************************************************
    REM * Show Recently Added Apps                      *
    REM * No known way to control this via command line *
    REM *************************************************
    
    REM   #####################################################################################
    REM   # The following settings are all for "Show most used apps".                         #
    REM   # To use: Uncomment either the DISABLE or the ENABLE section below. This will cause #
    REM   # the option to be enabled or disabled, but it will also make this option greyed    #
    REM   # out and unavailable in the GUI.                                                   #
    REM   #                                                                                   #
    REM   # To make the option selectabale again, run the commands in the section called      #
    REM   # "Re-enable GUI Access for Show most used apps" below. This will make the setting  #
    REM   # selectable in the GUI, but it will be disabled. You will need to enable it in     #
    REM   # the GUI.                                                                          #
    REM   #                                                                                   #
    REM   # By default, this file is set to turn disable "Show most used apps".               #
    REM   #                                                                                   #
    REM   # These settings are still located in Settings > Personalization > Start            #
    REM   #####################################################################################
    
    REM ********************************************************************************
    REM * Disable: Show most used apps                                                 *
    REM * Note that this seting affects all users and greys out this option in the GUI *
    REM ********************************************************************************
    
    REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /t REG_DWORD /d 0X00000002 /f > NUL
    REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /f > NUL 2>&1
    REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    
    REM ************************************************************************************
    REM * Enable: Show most used apps                                                      *
    REM * Note that this seting affects all users and greys out the this option in the GUI *
    REM ************************************************************************************
    
    REM REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /t REG_DWORD /d 0X00000001 /f > NUL
    REM REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /f > NUL 2>&1
    REM REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REM REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    REM REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REM REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    
    REM **********************************************************************************
    REM * Re-enable GUI Access for Show most used apps                                   *
    REM * Note that this seting will allow usage of the GUI to modify this setting again *
    REM **********************************************************************************
    
    REM REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /f > NUL 2>&1
    REM REG DELETE "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /f > NUL 2>&1
    REM REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REM REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    REM REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f > NUL 2>&1
    REM REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f > NUL 2>&1
    
    REM   #############################################
    REM   # End of Settings for "Show most used apps" #
    REM   #############################################
    
    REM *************************************************
    REM * Disable: Show recently opened items in Start, *
    REM * Jump Lists, and File Explorer                 *
    REM * NOTE: Setting this option will clear the      *
    REM * recent items list.                            *
    REM *************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackDocs" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # Settings > Personalization > Taskbar      #
    REM   #############################################
    
    REM ********************
    REM * Turn Off: Search *
    REM ********************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *********************************************************
    REM * Turn Off: Task view                                   *
    REM * NOTE: We are not using this option at this time. As a *
    REM * result, the command is commented out at this time.    *
    REM *********************************************************
    
    REM REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *****************************************
    REM * Turn Off: Widgets                     *
    REM * NOTE: This setting affects all users. *
    REM *****************************************
    
    REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v "AllowNewsAndInterests" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ******************
    REM * Turn Off: Chat *
    REM ******************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   ############################################################
    REM   # The following settings can be found here:                #
    REM   # Settings > Personalization > Taskbar > Taskbar behaviors #
    REM   ############################################################
    
    REM *********************************************************
    REM * Turn On: Automatically hide the taskbar               *
    REM * NOTE: We are not using this option at this time. As a *
    REM * result, the command is commented out at this time.    *
    REM *********************************************************
    
    powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"​ > NUL
    
    REM ********************************************************************************
    REM * Desktop icon spacing adjustment                                              *
    REM *                                                                              *
    REM * Default icon spacing settings:                                               *
    REM *                                                                              *
    REM * -1125 for "IconSpacing" and the same for IconVerticalSpacing". Set these to  *
    REM * -15 * spacing between icons in pixels. The entries below will set            *
    REM * "IconSpacing" to -1500, and "IconVerticalSpacing" to -1200. After setting,   *
    REM * either logoff/logon or reboot, then, right-click the desktop, choose "View", *
    REM * unceck "Align icons to grid", and then recheck it. The new settings should   *
    REM * now be in effect.                                                            *
    REM *                                                                              *
    REM * The lines to return the settings to defaults are also included below but are *
    REM * disabled.                                                                    *
    REM *                                                                              *
    REM * There is no setting in the GUI to alter these settings.                      *
    REM ********************************************************************************
    
    REM Set values to increase horizontal and vertical spacing a little bit.
    
    REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics" /v "IconSpacing" /t REG_SZ /d "-1500" /f > NUL
    REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics" /v "IconVerticalSpacing" /t REG_SZ /d "-1200" /f > NUL
    
    
    REM Set values to increase horizontal and vertical spacing a little bit. Currently this is commented out.
    
    REM REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics" /v "IconSpacing" /t REG_SZ /d "-1125" /f > NUL
    REM REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics" /v "IconVerticalSpacing" /t REG_SZ /d "-1125" /f > NUL
    
    REM      ################################
    REM      # End Personalization Settings #
    REM      ################################
    
    
    
    
    
    
    REM      ####################
    REM      # Account Settings #
    REM      ####################
    
    REM   ####################################################
    REM   # The following settings can be found here:        #
    REM   # Settings > Accounts > Sign-in options            #
    REM   ####################################################
    
    REM ***********************************************************************************
    REM * Turn off: For improved security, only allow Windows Hello sign-in for Microsoft *
    REM * accounts on this device (Recommeded)                                            *
    REM *                                                                                 *
    REM * When this setting is on, it enables passwordless sign-in. When using            *
    REM * Remote Desktop, you will need to enter a password. As a result, this            *
    REM * setting needs to be turned off.                                                 *
    REM *                                                                                 *
    REM * Note that this option may not show up in the GUI. I'm not 100% certain of the   *
    REM * reason for this, but suspect that it happens when Windows Hello is not enabled. *
    REM ***********************************************************************************
    
    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM **********************************************
    REM * Turn On: Automatically save my restartable *
    REM * apps and restart them when I sign back in  *
    REM **********************************************
    
    REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "RestartApps" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ************************************************************************************
    REM * Enable: Use my sign-in info to automatically finish setting up after an update   *
    REM * Affects all users, overrides setting in GUI, and greys out selection in GUI.     *
    REM *                                                                                  *
    REM * Note that settings to Disable and also to user user choice via GUI are included  *
    REM * but commented out below.                                                         *
    REM *                                                                                  *
    REM * Please note that I currently have the command for this registry setting disabled *
    REM * (commented) because it is on by default, but I wanted to make sure that this     *
    REM * setting was documented here.                                                     *
    REM ************************************************************************************
    
    REM REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableAutomaticRestartSignOn" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM Disable: Use my sign-in info to automatically finish setting up after an update
    REM Affects all users, overrides setting in GUI, and greys out selection in GUI.
    
    REM REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableAutomaticRestartSignOn" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM Restore user choice: Use my sign-in info to automatically finish setting up after an update
    REM Affects all users, restores the ability to change this setting in the GUI.
    
    REM REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableAutomaticRestartSignOn" /f > NUL 2>&1
    
    
    
    
    
    
    REM      ###############################
    REM      # Privacy & Security Settings #
    REM      ###############################
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # Settings > Privacy & security > General   #
    REM   #############################################
    
    REM **************************************************************************
    REM * Turn Off: Let apps show me personalized ads by using my advertising ID *
    REM **************************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *****************************************************************************************
    REM * Turn Off: Let websites show me locally relevant content by accessing my language list *
    REM *                                                                                       *
    REM * NOTE: We are not currently using this setting. Remove the "REM" below to enable it.   *
    REM *****************************************************************************************
    
    REM REG ADD "HKCU\Control Panel\International\User Profile" /v "HttpAcceptLanguageOptOut" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ***********************************************************************************
    REM * Turn Off: Let Windows improve Start and search results by tracking app launches *
    REM ***********************************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ***********************************************************
    REM * Turn Off: Show me suggested content in the Settings app *
    REM ***********************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338393Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353694Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353696Enabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   ##########################################################
    REM   # The following settings can be found here:              #
    REM   # Settings > Privacy & security > Diagnostics & feedback #
    REM   ##########################################################
    
    REM *******************************************
    REM * Turn Off: Send optional diagnostic data *
    REM *******************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack" /v "ShowedToastAtLevel" /t REG_DWORD /d 0x00000001 /f > NUL
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0x00000001 /f > NUL
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "MaxTelemetryAllowed" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM **********************************
    REM * Turn Off: Tailored Experiences *
    REM **********************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Privacy" /v "TailoredExperiencesWithDiagnosticDataEnabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM **************************************
    REM * Change Feedback Frequency to Never *
    REM **************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0x00000000 /f > NUL
    REG DELETE "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /f > NUL 2>&1
    
    REM   #####################################################
    REM   # The following settings can be found here:         #
    REM   # Settings > Privacy & security >  Activity history #
    REM   #####################################################
    
    REM *****************************************************
    REM * Disable: Store my activity history on this device *
    REM **********************************************************************************************
    REM * NOTE: This registry setting will also disable this option in Windows Settings. If you need *
    REM * to re-enable this option, use this registry entry:                                         *
    REM * REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "PublishUserActivities" /f *
    REM **********************************************************************************************
    
    REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "PublishUserActivities" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ***********************************************
    REM * Disable: Send Activity History to Microsoft *
    REM **********************************************************************************************
    REM * NOTE: This registry setting will also disable this option in Windows Settings. If you need *
    REM * to re-enable this option, use this registry entry:                                         *
    REM * REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "UploadUserActivities" /f  *
    REM **********************************************************************************************
    
    REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "UploadUserActivities" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   ######################################################
    REM   # The following settings can be found here:          #
    REM   # Settings > Privacy & security > Search permissions #
    REM   ######################################################
    
    REM *******************************************
    REM * Turn Off: Search History on this Device *
    REM *******************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v "IsDeviceSearchHistoryEnabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ************************************
    REM * Turn Off: Show search highlights *
    REM ************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /v "IsDynamicSearchBoxEnabled" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM      ###################################
    REM      # End Privacy & Security Settings #
    REM      ###################################
    
    REM      #########################
    REM      # File Explorer Setting #
    REM      #########################
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # File Explorer > ... > Options >  General  #
    REM   #############################################
    
    REM *******************************************
    REM * Turn On: Open File Explorer to: This PC *
    REM *******************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM *****************************************************************
    REM * Turn Off: Show recently used files                            *
    REM * NOTE: Turning this setting off clears the recent file history *
    REM *****************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM **********************************************************************
    REM * Turn Off: Show frequently used folders                             *
    REM * NOTE: Turning this setting off clears the frequent folders history *
    REM **********************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowFrequent" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ****************************************
    REM * Turn Off: Show files from Office.com *
    REM ****************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowCloudFilesInQuickAccess" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM   #############################################
    REM   # The following settings can be found here: #
    REM   # File Explorer > ... > Options >  View     #
    REM   #############################################
    
    REM ********************************************************
    REM * Turn On: Decrease space between items (compact view) *
    REM ********************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "UseCompactMode" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ***********************************************
    REM * Turn On: Display full path in the title bar *
    REM ***********************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" /v "FullPath" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ***************************************************
    REM * Turn On: Show hidden files, folders, and drives *
    REM ***************************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM *******************************
    REM * Turn Off: Hide empty drives *
    REM *******************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideDrivesWithNoMedia" /t REG_DWORD /d 0x00000000 /f > NUL
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideDrivesWithNoMedia" /f > NUL 2>&1
    
    REM **************************************************
    REM * Turn Off: Hide extensions for known file types *
    REM **************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM **************************************************************
    REM * Turn On: Show encrypted and compressed NTFS files in color *
    REM **************************************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowEncryptCompressedColor" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM **********************************************
    REM * Turn Off: Show sync provider notifications *
    REM **********************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSyncProviderNotifications" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM ********************************************
    REM * Turn On: Use check boxes to select items *
    REM ********************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "AutoCheckSelect" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM **********************************************
    REM * Turn Off: Use Sharing Wizard (Recommended) *
    REM **********************************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "SharingWizardOn" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM **********************************
    REM * Turn On: Expand to open folder *
    REM **********************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "NavPaneExpandToCurrentFolder" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM *****************************
    REM * Turn On: Show all folders *
    REM *****************************
    
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "NavPaneShowAllFolders" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM ***************************
    REM * Turn On: Show libraries *
    REM ***************************
    
    REG ADD "HKCU\Software\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM *************************
    REM * Turn On: Show Network *
    REM ********************************************************************************************************************
    REM * NOTE: This setting will override the setting in the GUI. To turn this back off use one of these two options:     *
    REM *                                                                                                                  *
    REM * 1) Set the following registry entry (the GUI will still be disabled but the setting will be turned off):         *
    REM * REG ADD "HKCU\Software\Classes\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /v "System.IsPinnedToNameSpaceTree" *
    REM * /t REG_DWORD /d 0x00000000 /f                                                                                    *
    REM *                                                                                                                  *
    REM * 2) To Re-enable the GUI run this command to delete the registry entry:                                           *
    REM * REG DELETE "HKCU\Software\Classes\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}"                                  *
    REM * /v "System.IsPinnedToNameSpaceTree" /f                                                                           *
    REM ********************************************************************************************************************
    
    REG ADD "HKCU\Software\Classes\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM *************************
    REM * Turn On: Show This PC *
    REM ********************************************************************************************************************
    REM * NOTE: This setting will override the setting in the GUI. To turn this back off use one of these two options:     *
    REM *                                                                                                                  *
    REM * 1) Set the following registry entry (the GUI will still be disabled but the setting will be turned off):         *
    REM * REG ADD "HKCU\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /v "System.IsPinnedToNameSpaceTree" *
    REM * /t REG_DWORD /d 0x00000000 /f                                                                                    *
    REM *                                                                                                                  *
    REM * 2) To Re-enable the GUI run this command to delete the registry entry:                                           *
    REM * REG DELETE "HKCU\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"                                  *
    REM * /v "System.IsPinnedToNameSpaceTree" /f                                                                           *
    REM ********************************************************************************************************************
    
    REG ADD "HKCU\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0x00000001 /f > NUL
    
    
    REM   ##################################################################################################
    REM   # This section will allow you to customize the templates used to display file in File Explorer.  #
    REM   # There is an automatic setting to allow Windows to pick the template best suited to each        #
    REM   # folder (this is the default), General items, Documents, Pictures, Music, and Videos.           #
    REM   #                                                                                                #
    REM   # Specifying a template for all drives and folders will disable Automatic Folder Type Discovery. #
    REM   # It does not affect the Quick access, This PC, Libraries, and Network shell folders.            #
    REM   #                                                                                                #
    REM   # To implement this section, perform the following actions:                                      #
    REM   #                                                                                                #
    REM   # Uncomment ONE of the six OPTION sections below. For example, Option 1. Option 1 is different   #
    REM   # than the others. It resets everything back to default settings. Options 2 through 6 will set   #
    REM   # the template type for all drives and folders to the type for the section you uncommented.      #
    REM   # For example, Option 2 will set all drives and folders to the "General items" template. If a    #
    REM   # user subsequently selects View > <Some View Option> in File Explorer, that will override the   #
    REM   # setting of these registry entries, but only for those locations to which the user applied the  #
    REM   # View settings. This allows the user to create their own set of exceptions.                     #
    REM   #                                                                                                #
    REM   # In sections 2 through 6, if you comment out the sections "Resets folder view settings, window  #
    REM   # size and position of all folders" and "To reset 'Apply to Folders' views to default for all    #
    REM   # folder types", then it will still set the template type for all drives and folders to the type #
    REM   # for the section you uncommented, but it will NOT alter the custom View settings that a user    #
    REM   # may have set.                                                                                  #
    REM   ##################################################################################################
    
    
    REM ******************************************************************************
    REM * Option 1                                                                   *
    REM *                                                                            *
    REM * This is the default setting. This will reset the template and views of all *
    REM * folders back to default, and enable Automatic Folder Type Discovery.       *
    REM ******************************************************************************
    
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    
    REM *************************************************************
    REM * Option 2                                                  *
    REM *                                                           *
    REM * Specify General items Template for All Drives and Folders *
    REM *************************************************************
    
    :: Resets folder view settings, window size and position of all folders
    Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    :: To reset "Apply to Folders" views to default for all folder types
    REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F > NUL 2>&1
    
    :: Specify General Items template to all folders
    REG ADD "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /V FolderType /T REG_SZ /D NotSpecified /F > NUL
    
    
    REM *********************************************************
    REM * Option 3                                              *
    REM *                                                       *
    REM * Specify Documents Template for All Drives and Folders *
    REM *********************************************************
    
    :: Resets folder view settings, window size and position of all folders
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    :: To reset "Apply to Folders" views to default for all folder types
    REM REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F > NUL 2>&1
    
    :: Specify Documents template to all folders
    REM REG ADD "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /V FolderType /T REG_SZ /D Documents /F > NUL
    
    
    REM ********************************************************
    REM * Option 4                                             *
    REM *                                                      *
    REM * Specify Pictures Template for All Drives and Folders *
    REM ********************************************************
    
    :: Resets folder view settings, window size and position of all folders
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    :: To reset "Apply to Folders" views to default for all folder types
    REM REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F > NUL 2>&1
    
    :: Specify Pictures template to all folders
    REM REG ADD "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /V FolderType /T REG_SZ /D Pictures /F > NUL
    
    
    REM *****************************************************
    REM * Option 5                                          *
    REM *                                                   *
    REM * Specify Music Template for All Drives and Folders *
    REM *****************************************************
    
    :: Resets folder view settings, window size and position of all folders
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    :: To reset "Apply to Folders" views to default for all folder types
    REM REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F > NUL 2>&1
    
    :: Specify Music template to all folders
    REM REG ADD "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /V FolderType /T REG_SZ /D Music /F > NUL
    
    
    REM ******************************************************
    REM * Option 6                                           *
    REM *                                                    *
    REM * Specify Videos Template for All Drives and Folders *
    REM ******************************************************
    
    :: Resets folder view settings, window size and position of all folders
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F > NUL 2>&1
    REM Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F > NUL 2>&1
    
    :: To reset "Apply to Folders" views to default for all folder types
    REM REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F > NUL 2>&1
    
    
    REM ********************************************************************
    REM * Common to all 6 options                                          *
    REM *                                                                  *
    REM * Each of the six options needs to end with a restart of explorer. *
    REM * The following lines stop and restart explorer.                   *
    REM ********************************************************************
    
    :: To kill and restart explorer
    taskkill /f /im explorer.exe > NUL
    start explorer.exe > NUL
    
    REM   ################################################
    REM   # End of Section to Configure Folder Templates #
    REM   ################################################
    
    
    REM      ################################
    REM      # End of File Explorer Setting #
    REM      ################################
    
    
    
    
    
    
    REM *************************************************************************************************
    REM * Disable Error Reporting                                                                       *
    REM *                                                                                               *
    REM * When a program stops responding, Windows can automatically report the problem to Microsoft    *
    REM * and check for a solution. By default Windows will send a problem report to Microsoft. This    *
    REM * option disables this. To re-enable, run these commands in an an elevated command prompt:      *
    REM *                                                                                               *
    REM * REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v "Disabled" *
    REM * /t REG_DWORD /d 0x00000000 /f                                                                 *
    REM *************************************************************************************************
    
    REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM      ######################################################################################################
    REM      # The following four settings all affect the operation of AutoPlay:                                  #
    REM      #                                                                                                    #
    REM      # PLEASE ENABLE ONLY ONE OF THE FOUR AVAILABLE OPTIONS. By default we have option #1 enabled.        #
    REM      #                                                                                                    #
    REM      # Option #1 affects AutoPlay for ALL media and devices. This setting can be re-enabled in the GUI as #
    REM      # described for that setting below.                                                                  #
    REM      #                                                                                                    #
    REM      # Option #2 and #3 below apply to individual parts of AutoPlay as detailed below:                    #
    REM      #                                                                                                    #
    REM      # Option #2 disables AutoPlay ONLY for volume type devices.                                          #
    REM      #                                                                                                    #
    REM      # Option #3 disables AutoPlay for ONLY non-volume type devices.                                      #
    REM      #                                                                                                    #
    REM      # Option #4 restores all AutoPlay settings to defaults (only for the current user).                  #
    REM      ######################################################################################################
    
    REM   #########################################################################################
    REM   # OPTION #1: Disable AutoPlay for ALL Devices (Both Volume and Non-Volume Type Devices) #
    REM   ####################################################################################################
    REM   # The following setting can be found here:                                                         #
    REM   # Settings > Bluetooth & devices > AutoPlay > Use AutoPlay for all media and devices               #
    REM   #                                                                                                  #
    REM   # This setting can also be found in Control Panel at this location:                                #
    REM   # NOTE: Select "View by: Large icons" or "View by: Small icons" when you first open Control Panel. #
    REM   # Control Panel > All Control Panel Items > AutoPlay > Use AutoPlay for all media and devices      #
    REM   ####################################################################################################
    
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" /v "DisableAutoplay" /f > NUL 2>&1
    
    REM   ##############################################
    REM   # OPTION #2: Disable AutoPlay for All Drives #
    REM   #################################################################################
    REM   # The following setting can be found here:                                      #
    REM   # There is no setting within Setup for this Option. This setting, when enabled, #
    REM   # can result in a pop-up dialog asking what to do with the device. Note that    #
    REM   # this setting only affects AutoPlay on volume type devices.                    #
    REM   #################################################################################
    REM   # NOTE: This setting applies to ALL users.                                      #
    REM   #######################################################################################################################
    REM   # To re-enable AutoPlay on volume type devices, run these registry commands:                                          #
    REM   #                                                                                                                     #
    REM   # REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f > NUL 2>&1 #
    REM   # REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f > NUL 2>&1 #
    REM   #######################################################################################################################
    
    REM Remove the "REM" from the following two lines to enable this option
    
    REM REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f > NUL 2>&1
    REM REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 0x000000ff /f > NUL
    
    REM   ######################################################
    REM   # OPTION #3: Disable AutoPlay for Non-Volume Devices #
    REM   ##################################################################################
    REM   # The following setting can be found here:                                       #
    REM   # There is no setting within Setup for this Option. This setting, when enabled,  #
    REM   # can result in a pop-up dialog asking what to do with the device. Note that     #
    REM   # this setting only affects AutoPlay on non-volume type devices such as a phone. #
    REM   ##################################################################################
    REM   # NOTE: This setting applies to ALL users.                                       #
    REM   #################################################################################################
    REM   # To re-enable AutoPlay for Non-Volume Devices, run these registry commands:                    #
    REM   #                                                                                               #
    REM   # REG DELETE "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /f #
    REM   # REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /f #
    REM   #################################################################################################
    
    REM Remove the "REM" from the following two lines to enable this option
    
    REM REG DELETE "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /f > NUL 2>&1
    REM REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM   ##############################################################
    REM   # OPTION #4: Reset AutoPlay to Defaults for the Current User #
    REM   ####################################################################################################
    REM   # Defaults can also be reset by going to the following location in the Control Panel:              #
    REM   # NOTE: Select "View by: Large icons" or "View by: Small icons" when you first open Control Panel. #
    REM   # Control Panel > All Control Panel Items > AutoPlay > Reset all defaults (at bottom of screen)    #
    REM   ####################################################################################################
    
    REM Remove the "REM" from the following two lines to enable this option
    
    REM REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection" /f > NUL 2>&1
    REM REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers" /f > NUL 2>&1
    
    REM      ############################
    REM      # End of AutoPlay Settings #
    REM      ############################
    
    
    
    
    
    
    REM      ###########################
    REM      # Customize Control Panel #
    REM      ###########################
    
    REM *********************************************
    REM * Set Control Panel to Display in Icon Mode *
    REM *********************************************
    
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ForceClassicControlPanel" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM      ######################################
    REM      # End of Control Panel Customization #
    REM      ######################################
    
    
    
    
    
    
    REM      ###################################
    REM      # Misc and Uncategorized Settings #
    REM      ###################################
    
    REM *********************************************************
    REM * Turn on: Remove System Requirements not Met Watermark *
    REM * This setting applies to some insider builds           *
    REM *                                                       *
    REM * This setting is currently commented out               *
    REM *********************************************************
    
    REM REG ADD "HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0x00000000 /f > NUL
    REM REG ADD "HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0x00000000 /f > NUL
    
    REM *******************************************************
    REM * Turn off: Screen Rotation Lock                      *
    REM * ON = 0; OFF = 1                                     *
    REM *                                                     *
    REM * Setting Slateenable to 0 will prevent auto rotation *
    REM *                                                     *
    REM * Currently commented out                             *
    REM *******************************************************
    
    REM REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" /v "Enable" /t REG_DWORD /d 0x00000001 /f > NUL
    REM REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" /v "SlateEnable" /t REG_DWORD /d 0x00000001 /f > NUL
    
    REM      ##########################################
    REM      # End of Misc and Uncategorized Settings #
    REM      ##########################################
      My Computers


  7. Posts : 7
    Windows 10
    Thread Starter
       #17

    Wow this is absolutely amazing! Thank you so much - looking forward to digging into it and following up again.
      My Computer


  8. Posts : 4,188
    Windows 11 Pro, 22H2
       #18

    I just want to add one comment. I should have noted this in my previous post, but didn't think of this at the time.

    The procedure I outlined above for creating the single autounattend.xml answer file is perfectly safe to perform on your primary system because you will not need to setup any reference system or VM. What you are essentially doing is simply creating a text file.

    Now, after you create that file, that's another story. You will then want to test it to see if it works. That will require either a physical machine or a VM to test on, but we can talk about your options once we get to that point
      My Computers


  9. Posts : 15,498
    Windows10
       #19

    TellurideTwilight said:
    hsehestedt, that is so great! Ultimately I am most disposed towards the types of solutions that you indicate you prefer yourself - outside of (perhaps) eliminating Cortana and onedrive and a couple of other extraneous / intrusive / resource-intensive services, I am less invested in "de-bloating" than in being able to quickly get my system back to a "like new" state with an unattended install. Years ago I generated some very simple batch files for alternative startup routines - but this was back in the day's of Windows 3.1! I would love whatever assistance and guidance you could provide, and I could not appreciate it any more!

    Thank you so much!
    Creating a custom iso to enable you to reinstate exact state of pc to same pc is possible as shown above, but it is a lot of work compared with image backups with 3rd party tools.

    Where custom isos are really useful is when transferring a current installation to a new pc with different hardware drivers, as you can inject drivers of new pc into the iso.


    You can do same by restoring an image backup to new pc but no guarantee it will boot, particularly if changing from ssd to nvme.

    Custom isos are really geared to the corporate market who create one iso and install on mulltiple devices.

    There is another 100% native windows tool to make an image backup of current pc that is really fast - much faster than creating an iso i.e. use of the FFU command (not predicated). See tutorial in tenforums.
      My Computer


  10. Posts : 7
    Windows 10
    Thread Starter
       #20

    cereberus, thank you so much for your insight! I have indeed downloaded Macrium Reflect and it will clearly play a role in helping me to effect my goals here - in fact after having imaged my most recent installation I might basically have more or less accomplished what I set out to do in the first place. All the same I remain intrigued by the project and will keep on puttering around - I so appreciate what everybody in the community contributes, particularly all the information that hsehestedt has so graciously shared!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:15.
Find Us




Windows 10 Forums