Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Re: working on a specific registry entry

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-20-2008   #1 (permalink)
Jon
Guest


 

Re: working on a specific registry entry

Not sure exactly what you're after, but possibly something like

$key = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs"
$key.GetValueNames() | `
where {([io.path]::GetFileName($_)).Contains('mscor')}

--
Jon


"Thufir" <hawat.thufir@xxxxxx> wrote in message
news:1d9d446c-5efe-4208-90e9-2bcc41f9d5f0@xxxxxx
Quote:

>I like:
>
> Getting a Single Registry Entry
>
> If you wish to retrieve a specific entry in a registry key, you can
> use one of several possible approaches. This example finds the value
> of DevicePath in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> \CurrentVersion.
>
> Using Get-ItemProperty, use the Path parameter to specify the name of
> the key, and the Name parameter to specify the name of the DevicePath
> entry.
>
> PS> Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows
> \CurrentVersion -Name DevicePath
>
>
> PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE
> \Software\
> Microsoft\Windows\CurrentVersion
> PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE
> \Software\
> Microsoft\Windows
> PSChildName : CurrentVersion
> PSDrive : HKLM
> PSProvider : Microsoft.PowerShell.Core\Registry
> DevicePath : C:\WINDOWS\inf
>
> This command returns the standard Windows PowerShell properties as
> well as the DevicePath property.
>
>
> http://technet.microsoft.com/en-us/l.../cc196357.aspx
>
>
>
> How would this be combined with the REG QUERY command to find and echo
> each entry which has references "foo.dll"?
>
>
> thanks,
>
> Thufir

My System SpecsSystem Spec
Old 05-21-2008   #2 (permalink)
Jon
Guest


 

Re: working on a specific registry entry

"Thufir" <hawat.thufir@xxxxxx> wrote in message
news:5a95c08a-1033-49b8-8a7a-82d8ee6b1303@xxxxxx
Quote:

> On May 20, 10:00 am, "Jon" <Email_Addr...@xxxxxx> wrote:
Quote:

>> Not sure exactly what you're after, but possibly something like
>>
>> $key = Get-Item
>> "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs"
>
> $key = all the SharedDLL's, or just one?

All the shared DLLs. Everything you see in the right pane when clicking the
key in the left pane within regedit.
Quote:

>
Quote:

>> $key.GetValueNames() | `
>> where {([io.path]::GetFileName($_)).Contains('mscor')}
>
>
> this returns the file info of the SharedDLL's?
>
It returns those entries there containing 'mscor' in their name.

It doesn't actually touch the file itself. It just parses the path like a
string, and examines the relevant info - in this particular case the
filename.
Quote:

>
>
> thanks,
>
> Thufir


--
Jon



My System SpecsSystem Spec
Old 05-21-2008   #3 (permalink)
Jon
Guest


 

Re: working on a specific registry entry

"Thufir" <hawat.thufir@xxxxxx> wrote in message
news:3fe67612-fd09-4ef6-bf78-fd0161abfa6a@xxxxxx
Quote:

> What I wanted to do was to go at it from the opposite direction, to
> find each entry which has "foo.dll" in the entry. Rather than:
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
>
> how could all of the hives, in their entirety, be searched?
>
>
>
> thanks,
>
> Thufir


To process the data in the entry, you could use something like ....

#-------------------
$key = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs"

foreach ($ValueKey in $key.GetValueNames()) {
if ($Key.GetValue($ValueKey) -eq 4096) {$ValueKey}
}
#-------------------

There are better tools around to search all the hives in their entirety.
You'd be sitting there a long time otherwise I would suspect. I wouldn't
personally recommend Powershell for that.

This is one such tool, which is pretty good...

RegScanner
http://www.nirsoft.net/utils/regscanner.html


--
Jon



My System SpecsSystem Spec
Old 05-22-2008   #4 (permalink)
Flowering Weeds
Guest


 

Re: working on a specific registry entry


"Jon"
Quote:

>
> There are better tools around to search
> all the hives in their entirety. You'd be
> sitting there a long time otherwise I would
> suspect. I wouldn't personally recommend
> Powershell for that.
>
Well if one is going to run and learn another
process well then perhaps try the free IIS's
Microsoft's (local or remote) data parser,
Log Parser 2.2 (with built-in Microsoft
ChartSpace chart maker)!

Log Parser parses almost anything in
almost any Windows language. If Log
Parse doesn't parse what one needs
(either via the Log Parser's command
line usage or by Log Parser's scripting
each parsed line field by field) well then
one can add into Log Parser their needed
parsing!

As for the registry:

LogParser.exe -h -i:reg

Input format: REG (Registry properties)
Returns properties of registry keys and values

Notice: IIS does not need to be running
or installed in order to use Log Parser
for either data parsing or chart making.

Search the Internet
(and this newsgroup)
for usage of:

Microsoft's Log Parser
command line usage,
or fully script enabled
either in COM or .NET
(from the IIS group)

Remember, ever since PowerShell
added HTTP / HTTPS usage (like IIS)
Log Parser became PowerShell's data
parser (like Log Parser is for IIS) too!



My System SpecsSystem Spec
Old 05-22-2008   #5 (permalink)
Jon
Guest


 

Re: working on a specific registry entry

"Flowering Weeds" <floweringnoweedsno@xxxxxx> wrote in message
news:up1azvEvIHA.3564@xxxxxx
Quote:

>

Nice plug. Are those flowering weeds legal?

--
Jon



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
making entry to contextmenu using registry Renuka General Discussion 2 08-04-2008 03:39 AM
Deleted Registry Entry Thomas Vista hardware & devices 5 03-20-2008 11:36 AM
Windows XP - undoing a registry entry oumalou .NET General 2 03-02-2008 09:16 PM
Logic One entry in registry tayonay Vista General 1 02-07-2008 06:23 PM
deleting registry entry SSI Vista General 3 03-04-2007 11:42 AM


Vistax64.com 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 2005-2008

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 47 48 49 50 51