initial scripts

This commit is contained in:
2026-04-02 01:46:54 +02:00
commit de927d3d8b
3 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Registry Path
$RegKey_FolderDiscovery = "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell"
# Delete the Bags and BagMRU keys if they exist
Remove-Item -Path "$RegKey_FolderDiscovery\Bags" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$RegKey_FolderDiscovery\BagMRU" -Recurse -Force -ErrorAction SilentlyContinue
# Create the Bags key
New-Item -Path $RegKey_FolderDiscovery -Name "Bags" -Force
# Create the AllFolders key inside Bags
New-Item -Path "$RegKey_FolderDiscovery\Bags" -Name "AllFolders" -Force
# Create the Shell key inside AllFolders
New-Item -Path "$RegKey_FolderDiscovery\Bags\AllFolders" -Name "Shell" -Force
# Create the FolderType string value and set its data to NotSpecified
New-ItemProperty -Path "$RegKey_FolderDiscovery\Bags\AllFolders\Shell" -Name "FolderType" -PropertyType String -Value "NotSpecified" -Force
Write-Output "Folder discovery has been disabled. Restarting File Explorer to see the changes."
Stop-Process -Name explorer -Force
Start-Process -FilePath "C:\Windows\explorer.exe"

View File

@@ -0,0 +1,38 @@
[CmdletBinding()]
param (
[Parameter()]
[switch]
$Disable
)
# GUID and Registry Path
$guid = "{86CA1AA0-34AA-4E8B-A509-50C905BAE2A2}"
$RegPath_ContextMenu = "HKCU:\Software\Classes\CLSID\"
$FullContextMenuStatus = "disabled"
function EnableFullContextMenu {
# Create the GUID key
New-Item -Path $RegPath_ContextMenu -Name $guid -Force | Out-Null
# Create the InprocServer32 key
New-Item -Path $RegPath_ContextMenu$guid -Name InprocServer32 -Value "" -Force | Out-Null
}
function DisableFullContextMenu {
# Delete the Context Menu overrides
Remove-Item -Path $RegPath_ContextMenu -Recurse -Force -ErrorAction SilentlyContinue
}
if ($Disable) {
DisableFullContextMenu
$FullContextMenuStatus = "disabled"
}
else {
EnableFullContextMenu
$FullContextMenuStatus = "enabled"
}
Write-Output "Full Context Menu has been $FullContextMenuStatus. Restarting File Explorer to see the changes..."
Stop-Process -Name explorer -Force
Start-Process -FilePath "C:\Windows\explorer.exe"