Skip to content

Instantly share code, notes, and snippets.

@guillaC
Last active August 17, 2023 20:20
Show Gist options
  • Save guillaC/39fdb8ae6cacce30d248d297a1204674 to your computer and use it in GitHub Desktop.
Save guillaC/39fdb8ae6cacce30d248d297a1204674 to your computer and use it in GitHub Desktop.
This PowerShell script explores CLSID registry keys in "HKLM:\SOFTWARE\Classes\CLSID", creating directories based on these values. Directories are within a "folders" subfolder, named "CLSID.CLSID".
$registryPath = "HKLM:\SOFTWARE\Classes\CLSID"
$clsidKeys = Get-ChildItem -Path $registryPath
foreach ($clsidKey in $clsidKeys) {
$name = $clsidKey.PSChildName
$directoryPath = ".\folders\$name.$name"
if (-not (Test-Path -Path $directoryPath)) {
New-Item -Path $directoryPath -ItemType Directory
Write-Host "créé : $directoryPath"
}
}
@guillaC
Copy link
Author

guillaC commented Aug 17, 2023

The provided PowerShell script iterates the CLSID registry keys under "HKLM:\SOFTWARE\Classes\CLSID" and creates directories based on the CLSID values.

image

Each directory is created in a subfolder called "folders" with a name in the format "CLSID.CLSID". The purpose of this script is to reveal and highlight the list of "hidden" directories on Windows that correspond to CLSID entries in the registry. If a directory with the specific CLSID name doesn't exist, the script creates it and outputs a message indicating its creation.

image

See Also : https://www.youtube.com/watch?v=BVXxcbX0biM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment