Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - How to see and change the value of (Default) in a registry key

Reply
 
Old 02-28-2007   #1 (permalink)
John


 
 

How to see and change the value of (Default) in a registry key

I love powershell's ability to deal with the registry. I love that I can
create a new key (HKLM:\Software\Classes\Folder\Shell\Command Prompt for
example). The challenge I can't seem to figure out is that Get-Childitem
doesn't show the "(Default)" item that gets created automatically. I need to
set the value of this item (to "Command Prompt Here" for example). How do
you do that?


My System SpecsSystem Spec
Old 02-28-2007   #2 (permalink)
Krishna Vutukuri[MSFT]


 
 

Re: How to see and change the value of (Default) in a registry key

set-itemproperty -path 'your path' -name '(Default)' -value 'your value'
should do the trick:

PS HKCU:\> mkdir test


Hive: Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER

SKC VC Name Property
--- -- ---- --------
0 0 test {}


PS HKCU:\> get-itemproperty test
PS HKCU:\> set-itemproperty -path test -name '(Default)' -value 'some value'
PS HKCU:\> get-itemproperty test


PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\test
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER
PSChildName : test
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
(default) : some value



PS HKCU:\>

--
Thanks
Krishna[MSFT]
Windows PowerShell Team
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"John" <John@discussions.microsoft.com> wrote in message
news:4CCEAF1C-5A2C-4118-96BA-6695BF0C5923@microsoft.com...
>I love powershell's ability to deal with the registry. I love that I can
> create a new key (HKLM:\Software\Classes\Folder\Shell\Command Prompt for
> example). The challenge I can't seem to figure out is that Get-Childitem
> doesn't show the "(Default)" item that gets created automatically. I need
> to
> set the value of this item (to "Command Prompt Here" for example). How do
> you do that?
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Set empty default registry key value using regwrite ? VB Script
Unable to change Permissions in Registry General Discussion
Search Registry value and change value data VB Script
Help!!! Svchost registry change blocked Vista General
How do I operate on (default) property of Registry provider? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46