Jump to content

Hello People, 

 

Looking to create a script to do the following in Reg Edit.

 

1. Load a specific users hive 

2. search for HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk\UserChoice

3. If the folder exists, remove it.

4.Unload the hive. 

 

I am very very new to PowerShell and so the most I have been able to find that I may be able to modify or use is the following : 

 

$regkeypath"hklm:\Software\Testkey" 
$value1 = (Get-ItemProperty $regkeypath).test -eq $null 
If ($value1 -eq $False) {Remove-ItemProperty -path HKLM:\SOFTWARE\Testkey -name test} 
Else {Write-Host "The value does not exist"}

Any help would be greatly appreciated. 

Jim.

 

*Mods : not sure if this is the correct place for this Topic, understand if its moved*

Cpu : AMD Ryzen 3 1200 (3.8Ghz), Motherboard : Gigabyte AB350 Gaming 3 - RAM : 8GB DDR4 2933 Team (Vulkan) memory, GPU : MSI GTX 980 4GB Case : Antec P50, Storage : 120GB Samsung SSD, 3TB WD Blue, PSU : 530w Thermaltake SPS-530MPC, Cooling : Artic freezer Pro 7, OS : Windows 10. 

 

Link to comment
https://linustechtips.com/topic/745616-powershell-script-removing-userchoice-folder/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×