Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: General » microsoft.public.windows.powershell
Thread: Playing with the registry

HTVi
TV Discussion Newsgroups

Playing with the registry
"Jan Egil R." <jer[ at ]umoeikt.no> 12/29/2008 11:48:51 PM
First of all....I`m running CTP3.

The values in the dropdown list with recent URL`s in Internet Explorer (hit
F4) are located in this registrykey: HKCU:\Software\Microsoft\Internet
Explorer\TypedURLs


With PowerShell the registrykeys can be found like this:
PS>Set-Location "HKCU:\Software\Microsoft\Internet Explorer\TypedURLs"
PS>(Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"}
url1
url2


Values can be found like this:
PS>(Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"} |
ForEach-Object { Get-ItemProperty . $_ }
PSPath :
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\TypedURLs
PSParentPath :
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer
PSChildName : TypedURLs
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
url1 : http://www.test1.com


PSPath :
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\TypedURLs
PSParentPath :
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer
PSChildName : TypedURLs
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
url2 : http://www.test2.com


I want to create a script which filters on the keyword "test2" and then
deletes the matching keys. Any suggestions on how this can be accomplished?

Re: Playing with the registry
"Marco Shaw [MVP]" <marco.shaw[ at ]_NO_SPAM_gmail.com> 12/30/2008 1:56:56 AM

[Quoted Text]
> I want to create a script which filters on the keyword "test2" and then
> deletes the matching keys. Any suggestions on how this can be accomplished?

This may help:
http://www.leeholmes.com/blog/HowDoISearchTheRegistryForAValueInPowerShell.aspx

Marco

--
*Microsoft MVP - Admin Frameworks
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition (due December
15th, 2008)
*PowerShell Co-Community Director - http://www.powershellcommunity.org
*Blog - http://marcoshaw.blogspot.com
Re: Playing with the registry
"Jan Egil R." <jer[ at ]umoeikt.no> 12/30/2008 4:26:12 AM
Thanks, I`ll give it a try!


"Marco Shaw [MVP]" <marco.shaw[ at ]_NO_SPAM_gmail.com> wrote in message
news:%23uZc2IiaJHA.1528[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
>
>> I want to create a script which filters on the keyword "test2" and then
>> deletes the matching keys. Any suggestions on how this can be
>> accomplished?
>
> This may help:
> http://www.leeholmes.com/blog/HowDoISearchTheRegistryForAValueInPowerShell.aspx
>
> Marco
>
> --
> *Microsoft MVP - Admin Frameworks
> https://mvp.support.microsoft.com/profile/Marco.Shaw
> *Co-Author - Sams Windows PowerShell Unleashed 2nd Edition (due December
> 15th, 2008)
> *PowerShell Co-Community Director - http://www.powershellcommunity.org
> *Blog - http://marcoshaw.blogspot.com

Re: Playing with the registry
Shay Levy [MVP] <no[ at ]addre.ss> 12/30/2008 2:35:44 PM
Hi Jan Egil R.,


Try this:


$url = get-itemproperty "HKCU:\Software\Microsoft\Internet Explorer\TypedURLs"
$items = $url.psbase.properties | where {$_.Name -like "url*" -AND $_.value
-like "*test*"} | foreach {$_.name}
remove-itemproperty -path $url.PSPath -name $items



---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar



J> First of all....I`m running CTP3.
J>
J> The values in the dropdown list with recent URL`s in Internet
J> Explorer (hit F4) are located in this registrykey:
J> HKCU:\Software\Microsoft\Internet Explorer\TypedURLs
J>
J> With PowerShell the registrykeys can be found like this:
J>
PS>> Set-Location "HKCU:\Software\Microsoft\Internet Explorer\TypedURLs"
PS>> (Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"}
PS>>
J> url1
J> url2
J> Values can be found like this:
J>
PS>> (Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"} |
PS>>
J> ForEach-Object { Get-ItemProperty . $_ }
J> PSPath :
J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
J> oft\Internet
J> Explorer\TypedURLs
J> PSParentPath :
J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
J> oft\Internet
J> Explorer
J> PSChildName : TypedURLs
J> PSDrive : HKCU
J> PSProvider : Microsoft.PowerShell.Core\Registry
J> url1 : http://www.test1.com
J> PSPath :
J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
J> oft\Internet
J> Explorer\TypedURLs
J> PSParentPath :
J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
J> oft\Internet
J> Explorer
J> PSChildName : TypedURLs
J> PSDrive : HKCU
J> PSProvider : Microsoft.PowerShell.Core\Registry
J> url2 : http://www.test2.com
J> I want to create a script which filters on the keyword "test2" and
J> then deletes the matching keys. Any suggestions on how this can be
J> accomplished?
J>

Re: Playing with the registry
"Jan Egil R." <jer[ at ]umoeikt.no> 12/31/2008 12:28:13 AM
Thanks, this is looking good, but $items doesn`t return anything. I`ve tried
with different of the URL`s I see in the registrykey..
Did it work on your computer?


"Shay Levy [MVP]" <no[ at ]addre.ss> wrote in message
news:95d808935eebf8cb38b3cb9e3050[ at ]news.microsoft.com...
[Quoted Text]
> Hi Jan Egil R.,
>
>
> Try this:
>
>
> $url = get-itemproperty "HKCU:\Software\Microsoft\Internet
> Explorer\TypedURLs"
> $items = $url.psbase.properties | where {$_.Name -like "url*" -AND
> $_.value -like "*test*"} | foreach {$_.name} remove-itemproperty -path
> $url.PSPath -name $items
>
>
>
> ---
> Shay Levy
> Windows PowerShell MVP
> http://blogs.microsoft.co.il/blogs/ScriptFanatic
> PowerShell Toolbar: http://tinyurl.com/PSToolbar
>
>
>
> J> First of all....I`m running CTP3.
> J> J> The values in the dropdown list with recent URL`s in Internet
> J> Explorer (hit F4) are located in this registrykey:
> J> HKCU:\Software\Microsoft\Internet Explorer\TypedURLs
> J> J> With PowerShell the registrykeys can be found like this:
> J> PS>> Set-Location "HKCU:\Software\Microsoft\Internet
> Explorer\TypedURLs"
> PS>> (Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"}
> PS>> J> url1
> J> url2
> J> Values can be found like this:
> J> PS>> (Get-Item . ).GetValueNames() |Where-Object {$_ -match "^url\d+"}
> |
> PS>> J> ForEach-Object { Get-ItemProperty . $_ }
> J> PSPath :
> J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
> J> oft\Internet
> J> Explorer\TypedURLs
> J> PSParentPath :
> J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
> J> oft\Internet
> J> Explorer
> J> PSChildName : TypedURLs
> J> PSDrive : HKCU
> J> PSProvider : Microsoft.PowerShell.Core\Registry
> J> url1 : http://www.test1.com
> J> PSPath :
> J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
> J> oft\Internet
> J> Explorer\TypedURLs
> J> PSParentPath :
> J> Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Micros
> J> oft\Internet
> J> Explorer
> J> PSChildName : TypedURLs
> J> PSDrive : HKCU
> J> PSProvider : Microsoft.PowerShell.Core\Registry
> J> url2 : http://www.test2.com
> J> I want to create a script which filters on the keyword "test2" and
> J> then deletes the matching keys. Any suggestions on how this can be
> J> accomplished?
> J>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen