From 34ad5e60cc7e44d3a8a742b77d59cb5862113eaa Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Fri, 23 Aug 2019 05:11:09 +0000 Subject: [PATCH] Create Set defaults.ps1 Powershell script to set defaults after reimaging to streamline process --- Set defaults.ps1 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Set defaults.ps1 diff --git a/Set defaults.ps1 b/Set defaults.ps1 new file mode 100644 index 0000000..aa71590 --- /dev/null +++ b/Set defaults.ps1 @@ -0,0 +1,34 @@ +#Setting power defaults +cmd /c Powercfg /Change standby-timeout-dc 180 +cmd /c Powercfg /Change standby-timeout-ac 0 + +cmd /c Powercfg /Change monitor-timeout-ac 60 +cmd /c Powercfg /Change monitor-timeout-dc 20 + +#Registry key paths +$paths = @("HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", +"HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu") +#Property name +$name = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" + +foreach ($path in $paths){ + $item = Get-ItemProperty -Path $path -Name $name -ErrorAction SilentlyContinue + + if($item) { + #set property value + Set-ItemProperty -Path $path -name $name -Value 0 + } Else { + #create a new property + New-ItemProperty -Path $path -Name $name -Value 0 -PropertyType DWORD | Out-Null + } + +} + + +$edgePath = "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" + +New-ItemProperty -Path $registryPath -Name "HomeButtonPage" -Value "C:\Program Files\BCG\BCGHomepage\BCGHomepage.html" + -PropertyType SZ -Force | Out-Null + +New-ItemProperty -Path $registryPath -Name "HomeButtonEnabled" -Value 1 + -PropertyType DWORD -Force | Out-Null