Scripted Configuration of Windows

0 comments

I find myself automating a large amount of Windows application settings both at home and at work. Here’s an overview of registry entries or other settings files for controlling a variety of things in Windows.

Internet Explorer

Bookmarks

IE bookmarks are saved in C:\Users\Administrator\Favorites\Favorites Bar
The folder does not exist before the first run of IE so create the directory first and then copy .lnk files in to it.

Show the Bookmarks Bar

HKCU:\Software\Microsoft\Internet Explorer\MINIE  
linksbandenabled=1

Popup Exceptions

HKCU:\Software\Microsoft\Internet Explorer\New Windows\Allow
"google.ca"=hex:00,00

Security Exceptions

HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\google.ca\drive
"https"=dword:00000001

Disable IE First Run Messages

HKLM:\Software\Policies\Microsoft\Internet Explorer\Main
DisableFirstRunCustomize=1

Other IE Configuration

Most IE settings are easiest to configure by download the Microsoft Internet Explorer Administration Kit (IEAK). When run it steps through various IE settings and creates a configuration msi that can be run to auto configure IE.


Chrome

Bookmarks

Chrome bookmarks are saved in C:\Program Files (x86)\Google\Chrome\bookmarks.html
Export the bookmarks.html file from a configured copy of Chrome.

Configuration File

Most Chrome settings are controlled by the master_preferences file in C:\Program Files (x86)\Google\Chrome\Application.

Here’s a sample of a file for settings the homepage, showing the bookmarks bar, and disabling a number of first run prompts.

{
"homepage": "http://www.google.ca",
"homepage_is_newtabpage": false,
"browser" : {
    "check_default_browser" : false
},
"distribution":{
"msi":true,
"system_level":true,
"verbose_logging":true,
"import_home_page": true,
"show_welcome_page": false,
"skip_first_run_ui": true,
"import_bookmarks": false,
"import_bookmarks_from_file": "C:\\Program Files (x86)\\Google\\Chrome\\bookmarks.html",
"suppress_first_run_bubble": true,
"do_not_create_desktop_shortcut": true,
"do_not_create_quick_launch_shortcut": true,
"suppress_first_run_default_browser_prompt": true
},
"bookmark_bar" : { 
    "show_on_all_tabs" : true 
}, 
"first_run_tabs" : [
    "new_tab_page" 
  ] 
}

Firefox

Bookmarks

Firefox bookmarks are saved in C:\Program Files (x86)\Mozilla Firefox\bookmarks.html
Export the bookmarks.html file from a configured copy of Firefox.

Show the Bookmarks Bar

Create a xulstore.json file with the following contents:

{"chrome://browser/content/browser.xul":{"navigator-toolbox":{"iconsize":"small"},"main-window":{"width":"1200","height":"740","screenX":"4","screenY":"4","sizemode":"maximized"},"PersonalToolbar":{"collapsed":"false"},"sidebar-box":{"sidebarcommand":"","width":"","src":""},"sidebar-title":{"value":""}},"about:config":{"prefCol":{"ordinal":"1","sortDirection":"ascending"},"lockCol":{"ordinal":"3"},"typeCol":{"ordinal":"5"},"valueCol":{"ordinal":"7"}}}

Copy the file to C:\Program Files (x86)\Mozilla Firefox\browser\defaults\profile\xulstore.json.

The PersonalToolbar collapsed=false portion makes the bookmarks bar visible.

Preferences

The main Firefox settings are stored in C:\Users\\AppData\Roaming\Mozilla\Firefox\Profiles\.default\prefs.js

Copy this file from a configured copy of Firefox to C:\Program Files (x86)\Mozilla Firefox\browser\defaults\profile\prefs.js

This default profile is used when a new user runs Firefox. So on a new machine copy over the prefs.js file before running Firefox for the first time.

Some important preferences in the prefs.js file: Bookmarks location:

user_pref("browser.bookmarks.file", "C:\\Program Files (x86)\\Mozilla Firefox\\bookmarks.html");

Default search engine:

user_pref("browser.search.defaultenginename", "Google");

Homepage:

user_pref(“browser.startup.homepage”, “http://google.ca/”);


Microsoft Edge

Bookmarks

Edge bookmarks are saved in C:\Users\Administrator\AppData\Local\Packages\ Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\User\Default\Favorites
Add .lnk files to it.


Disable Cortana on Windows 10

HKLM:\Software\Policies\Microsoft\Windows\Windows Search
AllowCortana=0

Enable Running of Unsigned PowerShell Scripts

HKLM:\Software\Microsoft\PowerShell\1\shellids\Microsoft.PowerShell
ExecutionPolicy="Remote Signed"

Disable Java Updates

HKLM:\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy
bUpdater=0

Disable Adobe Reader Updates

HKLM:\Software\Policies\Adobe\Adobe Acrobat\DC\FeatureLockDown
EnabledJavaUpdates=0

Disable Office First Run Messages

HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\General
ShownFirstRunOptin=1

Allow Elevated Users in Windows 8.1/10 to see Mapped Network Shares

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
EnableLinkedConnections=1

Disable Windows 8.1 First Run Messages

HKLM:\Software\Policies\Microsoft\Windows\EdgeUI
DisableHelpSticker=1

Preserve Power Settings During Sysprep

HKLM:\System\CurrentControlSet\Control\Power
CustomizeDuringSetup=0

Disable the Firewall

netsh advfirewall set DomainProfile state off
netsh advfirewall set PrivateProfile state off
netsh advfirewall set PublicProfile state off

Disable Hibernate

powercfg -h off

Show File Name Extension

HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
HideFileExt=0

Set UAC Level to Lowest

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
EnableLUA=1
ConsentPromptBehaviorAdmin=0

Change Windows 8.1/10 Lock Screen Image

HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization
LockScreenImage=<path to image>

Change Colors in Windows 8.1

HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent
MotionAccentId_v1.00=219
StartColor=<hex of color>
AccentColor=<hex of color>

Make Windows 8.1 Open to Desktop at Login

HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage
OpenAtLogon=0
DesktopFirst=1

Set Timezone

tzutil /s "Eastern Standard Time"

Check for and Install Windows Updates

C:\Windows\System32\wuauclt.exe /resetauthorization
C:\Windows\System32\wuauclt.exe /detectnow
C:\Windows\System32\wuauclt.exe /reportnow
C:\Windows\System32\wuauclt.exe /updatenow

Leave a Comment

Previous post:

Next post: