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 Tutorial - BUG? Registry keys with / in names

Reply
 
Old 09-04-2007   #1 (permalink)
Roman Kuzmin
Guest


 
 

BUG? Registry keys with / in names

It looks like Registry provider or Get-ChildItem (or both, or something else
in the engine) has troubles with registry key names containing / in them (it
is a valid symbol for registry names). Get-ChildItem does not return items
with such names. Can anybody confirm this?

--
Thanks,
Roman Kuzmin
PowerShellFar and FarNET: http://code.google.com/p/farnet/



My System SpecsSystem Spec
Old 09-04-2007   #2 (permalink)
Shay Levi
Guest


 
 

Re: BUG? Registry keys with / in names

I guess the "/" sign confuses the provider cause it's suppose to be a hierarchy
delimiter?

Anyway, under HKCU I created a new key with the name "NameWith/Slash" and
inside of it I created a string value with the name "ValueWith/Slash"

Non shows when listing HKCU with PowerShell


Shay
http://scriptolog.blogspot.com


Quote:

> It looks like Registry provider or Get-ChildItem (or both, or
> something else in the engine) has troubles with registry key names
> containing / in them (it is a valid symbol for registry names).
> Get-ChildItem does not return items with such names. Can anybody
> confirm this?
>

My System SpecsSystem Spec
Old 09-04-2007   #3 (permalink)
Shay Levi
Guest


 
 

Re: BUG? Registry keys with / in names

Running REG.exe emmits the key


PS HKCU:\> reg query hkcu

! REG.EXE VERSION 3.0

HKEY_CURRENT_USER

(...)
HKEY_CURRENT_USER\NameWith/Slash
(...)
HKEY_CURRENT_USER\Network
HKEY_CURRENT_USER\Printers
HKEY_CURRENT_USER\Software
(...)


# query the key
PS HKCU:\> reg query HKEY_CURRENT_USER\NameWith/Slash

! REG.EXE VERSION 3.0

HKEY_CURRENT_USER\NameWith/Slash
ValueWith/Slash REG_SZ 123



Notice that the "\" sign became "/"?


Shay
http://scriptolog.blogspot.com


Quote:

> I guess the "/" sign confuses the provider cause it's suppose to be a
> hierarchy delimiter?
>
> Anyway, under HKCU I created a new key with the name "NameWith/Slash"
> and inside of it I created a string value with the name
> "ValueWith/Slash"
>
> Non shows when listing HKCU with PowerShell
>
> Shay
> http://scriptolog.blogspot.com
Quote:

>> It looks like Registry provider or Get-ChildItem (or both, or
>> something else in the engine) has troubles with registry key names
>> containing / in them (it is a valid symbol for registry names).
>> Get-ChildItem does not return items with such names. Can anybody
>> confirm this?
>>

My System SpecsSystem Spec
Old 09-04-2007   #4 (permalink)
Shay Levi
Guest


 
 

Re: BUG? Registry keys with / in names

Got back to regedit.exe and tried to replace "\" with "/"
I got the following error:

The registry editor cannot rename "NameWith/Slash". Specify a key name without
a backslash (\).

Shay
http://scriptolog.blogspot.com


Quote:

> Running REG.exe emmits the key
>
> PS HKCU:\> reg query hkcu
>
> ! REG.EXE VERSION 3.0
>
> HKEY_CURRENT_USER
>
> (...)
> HKEY_CURRENT_USER\NameWith/Slash
> (...)
> HKEY_CURRENT_USER\Network
> HKEY_CURRENT_USER\Printers
> HKEY_CURRENT_USER\Software
> (...)
> # query the key
> PS HKCU:\> reg query HKEY_CURRENT_USER\NameWith/Slash
> ! REG.EXE VERSION 3.0
>
> HKEY_CURRENT_USER\NameWith/Slash
> ValueWith/Slash REG_SZ 123
> Notice that the "\" sign became "/"?
>
> Shay
> http://scriptolog.blogspot.com
Quote:

>> I guess the "/" sign confuses the provider cause it's suppose to be a
>> hierarchy delimiter?
>>
>> Anyway, under HKCU I created a new key with the name "NameWith/Slash"
>> and inside of it I created a string value with the name
>> "ValueWith/Slash"
>>
>> Non shows when listing HKCU with PowerShell
>>
>> Shay
>> http://scriptolog.blogspot.com
Quote:

>>> It looks like Registry provider or Get-ChildItem (or both, or
>>> something else in the engine) has troubles with registry key names
>>> containing / in them (it is a valid symbol for registry names).
>>> Get-ChildItem does not return items with such names. Can anybody
>>> confirm this?
>>>

My System SpecsSystem Spec
Old 09-04-2007   #5 (permalink)
Shay Levi
Guest


 
 

Re: BUG? Registry keys with / in names

>> Notice that the "\" sign became "/"?

Please ignore this, dont know where I got it from

Shay
http://scriptolog.blogspot.com


Quote:

> Running REG.exe emmits the key
>
> PS HKCU:\> reg query hkcu
>
> ! REG.EXE VERSION 3.0
>
> HKEY_CURRENT_USER
>
> (...)
> HKEY_CURRENT_USER\NameWith/Slash
> (...)
> HKEY_CURRENT_USER\Network
> HKEY_CURRENT_USER\Printers
> HKEY_CURRENT_USER\Software
> (...)
> # query the key
> PS HKCU:\> reg query HKEY_CURRENT_USER\NameWith/Slash
> ! REG.EXE VERSION 3.0
>
> HKEY_CURRENT_USER\NameWith/Slash
> ValueWith/Slash REG_SZ 123
> Notice that the "\" sign became "/"?
>
> Shay
> http://scriptolog.blogspot.com
Quote:

>> I guess the "/" sign confuses the provider cause it's suppose to be a
>> hierarchy delimiter?
>>
>> Anyway, under HKCU I created a new key with the name "NameWith/Slash"
>> and inside of it I created a string value with the name
>> "ValueWith/Slash"
>>
>> Non shows when listing HKCU with PowerShell
>>
>> Shay
>> http://scriptolog.blogspot.com
Quote:

>>> It looks like Registry provider or Get-ChildItem (or both, or
>>> something else in the engine) has troubles with registry key names
>>> containing / in them (it is a valid symbol for registry names).
>>> Get-ChildItem does not return items with such names. Can anybody
>>> confirm this?
>>>

My System SpecsSystem Spec
Old 09-04-2007   #6 (permalink)
Roman Kuzmin
Guest


 
 

Re: BUG? Registry keys with / in names

Thank you, Shay

So, it looks like a bug to me. I'll report it later today.

--
Thanks,
Roman Kuzmin
PowerShellFar and FarNET: http://code.google.com/p/farnet/

"Shay Levi" <no@xxxxxx> wrote in message
news:8766a94464ce8c9bd11016f687c@xxxxxx
Quote:

>I guess the "/" sign confuses the provider cause it's suppose to be a
>hierarchy delimiter?
>
> Anyway, under HKCU I created a new key with the name "NameWith/Slash" and
> inside of it I created a string value with the name "ValueWith/Slash"
>
> Non shows when listing HKCU with PowerShell
>
>
> Shay
> http://scriptolog.blogspot.com
>
>
>
Quote:

>> It looks like Registry provider or Get-ChildItem (or both, or
>> something else in the engine) has troubles with registry key names
>> containing / in them (it is a valid symbol for registry names).
>> Get-ChildItem does not return items with such names. Can anybody
>> confirm this?
>>
>
>

My System SpecsSystem Spec
Old 09-04-2007   #7 (permalink)
Shay Levi
Guest


 
 

Re: BUG? Registry keys with / in names

Maybe you should wait for the other guys to reply. Somebody may contribute
to your problem


Shay
http://scriptolog.blogspot.com


Quote:

> Thank you, Shay
>
> So, it looks like a bug to me. I'll report it later today.
>
> "Shay Levi" <no@xxxxxx> wrote in message
> news:8766a94464ce8c9bd11016f687c@xxxxxx
>
Quote:

>> I guess the "/" sign confuses the provider cause it's suppose to be a
>> hierarchy delimiter?
>>
>> Anyway, under HKCU I created a new key with the name "NameWith/Slash"
>> and inside of it I created a string value with the name
>> "ValueWith/Slash"
>>
>> Non shows when listing HKCU with PowerShell
>>
>> Shay
>> http://scriptolog.blogspot.com
Quote:

>>> It looks like Registry provider or Get-ChildItem (or both, or
>>> something else in the engine) has troubles with registry key names
>>> containing / in them (it is a valid symbol for registry names).
>>> Get-ChildItem does not return items with such names. Can anybody
>>> confirm this?
>>>

My System SpecsSystem Spec
Old 09-04-2007   #8 (permalink)
Brandon Shell
Guest


 
 

Re: BUG? Registry keys with / in names

Have you checked on connect? I am pretty sure this bug has been filed. I
remember a post similar to yours about 6mon back.

"Roman Kuzmin" <z@xxxxxx> wrote in message
news:egCupvt7HHA.980@xxxxxx
Quote:

> It looks like Registry provider or Get-ChildItem (or both, or something
> else in the engine) has troubles with registry key names containing / in
> them (it is a valid symbol for registry names). Get-ChildItem does not
> return items with such names. Can anybody confirm this?
>
> --
> Thanks,
> Roman Kuzmin
> PowerShellFar and FarNET: http://code.google.com/p/farnet/
>
>
My System SpecsSystem Spec
Old 09-04-2007   #9 (permalink)
Roman Kuzmin
Guest


 
 

Re: BUG? Registry keys with / in names

Brandon,



You are right:

https://connect.microsoft.com/feedba...8838&SiteID=99



The bug was reported at 17/11/2006 and the status is still 'active', i.e.
there is no response from Microsoft.



--
Thanks,
Roman Kuzmin
PowerShellFar and FarNET: http://code.google.com/p/farnet/



"Brandon Shell" <tshell.mask@xxxxxx> wrote in message
news:%23d86pFv7HHA.1208@xxxxxx
Quote:

> Have you checked on connect? I am pretty sure this bug has been filed. I
> remember a post similar to yours about 6mon back.
>
> "Roman Kuzmin" <z@xxxxxx> wrote in message
> news:egCupvt7HHA.980@xxxxxx
Quote:

>> It looks like Registry provider or Get-ChildItem (or both, or something
>> else in the engine) has troubles with registry key names containing / in
>> them (it is a valid symbol for registry names). Get-ChildItem does not
>> return items with such names. Can anybody confirm this?
>>
>> --
>> Thanks,
>> Roman Kuzmin
>> PowerShellFar and FarNET: http://code.google.com/p/farnet/
>>
>>
>

My System SpecsSystem Spec
Old 09-04-2007   #10 (permalink)
Jon
Guest


 
 

Re: BUG? Registry keys with / in names


"Roman Kuzmin" <z@xxxxxx> wrote in message
news:egCupvt7HHA.980@xxxxxx
Quote:

> It looks like Registry provider or Get-ChildItem (or both, or something
> else in the engine) has troubles with registry key names containing / in
> them (it is a valid symbol for registry names). Get-ChildItem does not
> return items with such names. Can anybody confirm this?
>
> --
> Thanks,
> Roman Kuzmin
> PowerShellFar and FarNET: http://code.google.com/p/farnet/
>
>

A few thoughts on how you might be able to get round the bug for the
moment.....

#Write a key containing / to the registry
$WshShell = no -com wscript.shell
$WshShell.RegWrite('HKCU\DeleteMe/Later\',"","REG_SZ")

#Enumerate subkeys
$strcomputer = ''
[Reflection.Assembly]::LoadWithPartialName("microsoft.win32")
$reghive = [Microsoft.Win32.RegistryHive]
$regkey =
[microsoft.win32.registrykey]:penremotebasekey($reghive::CurrentUser,$strcomputer)
$regkey.GetSubKeyNames()

#Remove the key
$WshShell.RegDelete('HKCU\DeleteMe/Later\')
$regkey.GetSubKeyNames()

--
Jon


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
registry keys VB Script
Re: How can I delete registry keys Vista installation & setup
What are these Registry Keys? Vista General
Re: Missing Registry Keys Vista hardware & devices
Mcafee Registry Keys or other VB Script


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