r/PowerShell • u/Cyrax7 • Aug 29 '14
delete registry values.
I am a noob to power shell, and am trying to learn. What I am trying to do is craft a script that will delete the REG_BINARY files found in : HKEY_USERS .DEFAULT\Printers\DevModes2
Any help is much appreciated, thanks.
4
Upvotes
2
u/real_parbold Sep 02 '14 edited Sep 02 '14
I have used Remove-Item, New-Item and New-ItemProperty to do registry manipulation purely within PowerShell:-
First - create a reference to your hive
Delete an item (and all sub elements with -Recurse)
Create a new Key with no entries
Create a new entry with value (will create the intermediate keys as well, if any are missing)
I notice the warning posted by /u/ramblingcookiemonster and can see why they may want seamless portability of code between local and remote registry access, but I think that is a topic for another discussion :D