From a735da54f7143162f9e6cc2203b0cb8a822fbbaf Mon Sep 17 00:00:00 2001 From: tumpio Date: Wed, 12 Aug 2015 11:25:48 +0300 Subject: [PATCH 1/3] new script: disable login screen background image --- scripts/disable-logon-background.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/disable-logon-background.ps1 diff --git a/scripts/disable-logon-background.ps1 b/scripts/disable-logon-background.ps1 new file mode 100644 index 0000000..21a09be --- /dev/null +++ b/scripts/disable-logon-background.ps1 @@ -0,0 +1,14 @@ +# Description: +# This script will disable the login screen background image + +echo "Disabling login screen background" +$reg = @" +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System] +"DisableLogonBackgroundImage"=dword:00000001 +"@ +$regfile = "$env:windir\Temp\registry.reg" +$reg | Out-File $regfile +Start-Process "regedit.exe" -ArgumentList ("/s", "$regfile") -Wait +rm $regfile From 3886da53c44f94f9eb7e9b922cd3fe9966a5990c Mon Sep 17 00:00:00 2001 From: tumpio Date: Wed, 12 Aug 2015 11:34:54 +0300 Subject: [PATCH 2/3] new script: remove user folders under This PC --- scripts/remove-user-folders-under-this-pc.ps1 | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 scripts/remove-user-folders-under-this-pc.ps1 diff --git a/scripts/remove-user-folders-under-this-pc.ps1 b/scripts/remove-user-folders-under-this-pc.ps1 new file mode 100644 index 0000000..c5f75b7 --- /dev/null +++ b/scripts/remove-user-folders-under-this-pc.ps1 @@ -0,0 +1,42 @@ +# Description: +# This script will remove user folder from displaying under "This PC" +# in File Exlorer. If you do not want to disable certain user folders +# comment out the corresponding lines below. + +echo "Removing user folders under This PC" +$reg = @" +Windows Registry Editor Version 5.00 + +; Remove Desktop From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] +; Remove Documents From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}] +; Remove Downloads From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}] +; Remove Music From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}] +; Remove Pictures From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}] +; Remove Videos From This PC +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}] +[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] +"@ +$regfile = "$env:windir\Temp\registry.reg" +$reg | Out-File $regfile +Start-Process "regedit.exe" -ArgumentList ("/s", "$regfile") -Wait +rm $regfile From 1beffcb7a67ada67a52b03ab96b96f78a13b7db9 Mon Sep 17 00:00:00 2001 From: tumpio Date: Wed, 12 Aug 2015 11:58:40 +0300 Subject: [PATCH 3/3] Rebase to use reg-helper module --- scripts/disable-logon-background.ps1 | 12 ++++-------- scripts/remove-user-folders-under-this-pc.ps1 | 14 +++++--------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/scripts/disable-logon-background.ps1 b/scripts/disable-logon-background.ps1 index 21a09be..8a09678 100644 --- a/scripts/disable-logon-background.ps1 +++ b/scripts/disable-logon-background.ps1 @@ -1,14 +1,10 @@ # Description: # This script will disable the login screen background image -echo "Disabling login screen background" -$reg = @" -Windows Registry Editor Version 5.00 +Import-Module $PSScriptRoot\..\lib\reg-helper.psm1 +echo "Disabling login screen background image" +Import-Registry(@" [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System] "DisableLogonBackgroundImage"=dword:00000001 -"@ -$regfile = "$env:windir\Temp\registry.reg" -$reg | Out-File $regfile -Start-Process "regedit.exe" -ArgumentList ("/s", "$regfile") -Wait -rm $regfile +"@) diff --git a/scripts/remove-user-folders-under-this-pc.ps1 b/scripts/remove-user-folders-under-this-pc.ps1 index c5f75b7..786ec37 100644 --- a/scripts/remove-user-folders-under-this-pc.ps1 +++ b/scripts/remove-user-folders-under-this-pc.ps1 @@ -1,12 +1,12 @@ # Description: # This script will remove user folder from displaying under "This PC" -# in File Exlorer. If you do not want to disable certain user folders +# in File Exlorer. If you do not want to remove certain user folders # comment out the corresponding lines below. -echo "Removing user folders under This PC" -$reg = @" -Windows Registry Editor Version 5.00 +Import-Module $PSScriptRoot\..\lib\reg-helper.psm1 +echo "Removing user folders under This PC" +Import-Registry(@" ; Remove Desktop From This PC [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}] @@ -35,8 +35,4 @@ Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}] -"@ -$regfile = "$env:windir\Temp\registry.reg" -$reg | Out-File $regfile -Start-Process "regedit.exe" -ArgumentList ("/s", "$regfile") -Wait -rm $regfile +"@)