473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem accessing the registry with Vista

The following snippet (vb.net 2005) is working just fine in xp but not in
vista

in xp it lists all related sub keys in the registry just fine. in vista it
doesn't list certain ones (like Unimodem)

Dim rk As Microsoft.Win32.RegistryKey
rk =
My.Computer.Registry.LocalMachine.OpenSubKey("SOFT WARE\Microsoft\Windows\CurrentVersion")
For Each SubKeyName As String In rk.GetSubKeyNames()
Console.WriteLine(SubKeyName)
Next

Although this is not my real problem, i figure if i knew why its not working
in the above code i would have my real problem solved too.

I had tried fooling around with
System.Security.AccessControl.RegistryAccessRule statements, but either i'm
doing them wrong or i'm barking up the wrong tree.

any and all help would be appreciated.

Thanks, Rob

Apr 4 '07 #1
3 5769
The user identity under which the program is running must have permission to
read the registry keys you want to read.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Rob Latour" <ro*******@hotmail.comwrote in message
news:B4**********************************@microsof t.com...
The following snippet (vb.net 2005) is working just fine in xp but not in
vista

in xp it lists all related sub keys in the registry just fine. in vista
it doesn't list certain ones (like Unimodem)

Dim rk As Microsoft.Win32.RegistryKey
rk =
My.Computer.Registry.LocalMachine.OpenSubKey("SOFT WARE\Microsoft\Windows\CurrentVersion")
For Each SubKeyName As String In rk.GetSubKeyNames()
Console.WriteLine(SubKeyName)
Next

Although this is not my real problem, i figure if i knew why its not
working in the above code i would have my real problem solved too.

I had tried fooling around with
System.Security.AccessControl.RegistryAccessRule statements, but either
i'm doing them wrong or i'm barking up the wrong tree.

any and all help would be appreciated.

Thanks, Rob

Apr 4 '07 #2
Thanks Kevin, would it be possilbe that you could provide an example of how
I can grant this access?
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
The user identity under which the program is running must have permission
to read the registry keys you want to read.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Rob Latour" <ro*******@hotmail.comwrote in message
news:B4**********************************@microsof t.com...
>The following snippet (vb.net 2005) is working just fine in xp but not in
vista

in xp it lists all related sub keys in the registry just fine. in vista
it doesn't list certain ones (like Unimodem)

Dim rk As Microsoft.Win32.RegistryKey
rk =
My.Computer.Registry.LocalMachine.OpenSubKey("SOF TWARE\Microsoft\Windows\CurrentVersion")
For Each SubKeyName As String In rk.GetSubKeyNames()
Console.WriteLine(SubKeyName)
Next

Although this is not my real problem, i figure if i knew why its not
working in the above code i would have my real problem solved too.

I had tried fooling around with
System.Security.AccessControl.RegistryAccessRul e statements, but either
i'm doing them wrong or i'm barking up the wrong tree.

any and all help would be appreciated.

Thanks, Rob

Apr 4 '07 #3
I'm using a 64bit version of Vista and it looks like that is the problem,
the following article has my mind spinning :-)
http://msdn.microsoft.com/library/de...redirector.asp

but now i think i'm at least barking up the right tree ...

"Rob Latour" <ro*******@hotmail.comwrote in message
news:73**********************************@microsof t.com...
Thanks Kevin, would it be possilbe that you could provide an example of
how I can grant this access?
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
>The user identity under which the program is running must have permission
to read the registry keys you want to read.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Rob Latour" <ro*******@hotmail.comwrote in message
news:B4**********************************@microso ft.com...
>>The following snippet (vb.net 2005) is working just fine in xp but not
in vista

in xp it lists all related sub keys in the registry just fine. in vista
it doesn't list certain ones (like Unimodem)

Dim rk As Microsoft.Win32.RegistryKey
rk =
My.Computer.Registry.LocalMachine.OpenSubKey("SO FTWARE\Microsoft\Windows\CurrentVersion")
For Each SubKeyName As String In rk.GetSubKeyNames()
Console.WriteLine(SubKeyName)
Next

Although this is not my real problem, i figure if i knew why its not
working in the above code i would have my real problem solved too.

I had tried fooling around with
System.Security.AccessControl.RegistryAccessRu le statements, but either
i'm doing them wrong or i'm barking up the wrong tree.

any and all help would be appreciated.

Thanks, Rob

Apr 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: BigAbility | last post by:
is there registry in Longhorn( vista) ? i heard about Registry will disappear in longhorn. is it true?
6
by: Steve Teeples | last post by:
I have a piece of code (written is Visual Studio 2005) that is only reading the Security EventLog. On Windows XP Professiona/Home this code works just fine. int numberOfEntries =...
11
by: vovan | last post by:
I'm using this approach to read from registry. Dim f As New RegistryPermission(RegistryPermissionAccess.AllAccess, _ "HKEY_LOCAL_MACHINE\SOFTWARE\SRS Enterprises\Coordinator\Settings") 'Vlad...
6
by: vovan | last post by:
I'm asking for help one more time. Below are 2 procedures. The first one is used in VB 2005 Windows Form project. It works fine on XP, Vista. Private Sub RegistryReadingTest() Try Dim f As New...
2
by: =?Utf-8?B?QW5qYW5h?= | last post by:
Hello we creating a web application in ASP .net 2.0. we are trying to read font file path from registry as below Microsoft.Win32.RegistryKey registryKeyParen registryKeyChild =...
1
by: pavanG | last post by:
The following is the setup I have at home. The problem is I cannot ping Vista machine(192.168.2.5) from XP machine(192.168.2.2) So accessing it from Internet is Out of question My aim is to...
2
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
Hi, I have developed a VB application in VS2005 and deployed it sucessfully to XP using an MSI file built with a standard VS setup project. The MSI creates some keys under...
2
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at...
3
by: thephatp | last post by:
This is incredibly strange. I used regedit and went to HKEY_LOCAL_MACHINE and create a new subkey under "Software". I added a few more, then went into code to try to read them. I kept getting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.