diff --git a/src/playbook/Configuration/tweaks.yml b/src/playbook/Configuration/tweaks.yml index 85d5f4b88d..b2c2172d7e 100644 --- a/src/playbook/Configuration/tweaks.yml +++ b/src/playbook/Configuration/tweaks.yml @@ -225,7 +225,6 @@ actions: # -------------------------------------------------------------------------- # - !task: {path: 'tweaks\qol\explorer\remove-context-menus\cast-to-device.yml'} - !task: {path: 'tweaks\qol\explorer\remove-context-menus\extract-all.yml'} - - !task: {path: 'tweaks\qol\explorer\remove-context-menus\give-access-to.yml'} - !task: {path: 'tweaks\qol\explorer\remove-context-menus\include-in-library.yml'} - !task: {path: 'tweaks\qol\explorer\remove-context-menus\new-bitmap.yml'} - !task: {path: 'tweaks\qol\explorer\remove-context-menus\new-rtf.yml'} diff --git a/src/playbook/Configuration/tweaks/qol/explorer/remove-context-menus/give-access-to.yml b/src/playbook/Configuration/tweaks/qol/explorer/remove-context-menus/give-access-to.yml deleted file mode 100644 index b5b1ff2a80..0000000000 --- a/src/playbook/Configuration/tweaks/qol/explorer/remove-context-menus/give-access-to.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Remove 'Give access to' from Context Menu -description: Removes 'Give access to' from context menu -actions: - - !registryKey: {path: 'HKCR\*\shellex\ContextMenuHandlers\Sharing'} - - !registryKey: {path: 'HKCR\Directory\Background\shellex\ContextMenuHandlers\Sharing'} - - !registryKey: {path: 'HKCR\Directory\shellex\ContextMenuHandlers\Sharing'} - - !registryKey: {path: 'HKCR\Drive\shellex\ContextMenuHandlers\Sharing'} - - !registryKey: {path: 'HKCR\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing'} - - !registryKey: {path: 'HKCR\UserLibraryFolder\shellex\ContextMenuHandlers\Sharing'} diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Disable (default).reg b/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Disable (default).reg new file mode 100644 index 0000000000..62c51eed14 --- /dev/null +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Disable (default).reg @@ -0,0 +1,13 @@ +Windows Registry Editor Version 5.00 + +[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Sharing] + +[-HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Sharing] + +[-HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Sharing] + +[-HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\Sharing] + +[-HKEY_CLASSES_ROOT\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing] + +[-HKEY_CLASSES_ROOT\UserLibraryFolder\shellex\ContextMenuHandlers\Sharing] diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Enable.reg b/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Enable.reg new file mode 100644 index 0000000000..83b46cf957 Binary files /dev/null and b/src/playbook/Executables/AtlasDesktop/3. General Configuration/File Sharing/Give Access To Menu/Give Access To Menu Enable.reg differ diff --git a/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/DisableFileSharing.ps1 b/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/DisableFileSharing.ps1 index 315b39eae0..4bb572d39a 100644 --- a/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/DisableFileSharing.ps1 +++ b/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/DisableFileSharing.ps1 @@ -4,6 +4,7 @@ param ( [switch]$Silent ) +$networkDiscoveryConfigPath = "$([Environment]::GetFolderPath('Windows'))\AtlasDesktop\6. Advanced Configuration\Services\Network Discovery" $fileSharingConfigPath = "$([Environment]::GetFolderPath('Windows'))\AtlasDesktop\3. General Configuration\File Sharing" # Disable network items @@ -32,6 +33,8 @@ Get-NetFirewallRule | Where-Object { reg import "$networkDiscoveryConfigPath\Network Navigation Pane\Disable Network Navigation Pane (default).reg" | Out-Null +reg import "$fileSharingConfigPath\Give Access To Menu\Give Access To Menu Disable (default).reg" | Out-Null + if ($Silent) { exit } Write-Host "Completed!" -ForegroundColor Green diff --git a/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/EnableFileSharing.ps1 b/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/EnableFileSharing.ps1 index ffb46772df..1c743d8637 100644 --- a/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/EnableFileSharing.ps1 +++ b/src/playbook/Executables/AtlasModules/Scripts/ScriptWrappers/EnableFileSharing.ps1 @@ -41,6 +41,11 @@ if ($LASTEXITCODE -eq 1) { reg import "$([Environment]::GetFolderPath('Windows'))\AtlasDesktop\3. General Configuration\File Sharing\Network Navigation Pane\User Network Navigation Pane choice.reg" | Out-Null } +choice /c:yn /n /m "Would you like to restore the 'Give access to' context menu in Explorer? [Y/N] " +if ($LASTEXITCODE -eq 1) { + reg import "$([Environment]::GetFolderPath('Windows'))\AtlasDesktop\3. General Configuration\File Sharing\Give Access To Menu\Give Access To Menu Enable.reg" | Out-Null +} + Write-Host "Completed!" -ForegroundColor Green Write-Host "Press any key to exit... " -NoNewLine $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') | Out-Null