Sign in to follow this  
gkimsey

Registry Variables Don't Work On Windows 8?

Recommended Posts

See the attached test project. By running the RegistryWrite sequence and then the RegistryRead sequence, "Registry Test" should appear in the Alert window. Works for me on Windows 7 but not on Windows 8. I'm running as administrator on both.

Can you guys replicate this?

regtest.ctl

Share this post


Link to post
Share on other sites

No. Works fine on my Win8 Pro machine. Almost certainly the issue is your Windows security settings. You may have to run DAQFactory with elevated permissions or change some other setting.

Share this post


Link to post
Share on other sites

Okay, found the problem. Short answer: You were right, permissions issue.

Background for the next person who runs into this:

I discovered that DAQFactory was writing the registry variables to a virtualized registry location, but Windows apparently wasn't redirecting it there for the subsequent "read" (because it failed to read it back). Turns out it was doing this because I didn't properly install DAQFactory as an administrator.

This is one of those Windows Vista-and-later gotchas related to User Account Control (UAC). Even if you're an admin, if you don't right-click and use "Run as Administrator" AND you still have UAC enabled, you're not "really" running as an administrator. This results in DAQFactory.exe being installed with reduced permissions, which subsequently means it doesn't access the registry the same way.

So the solution is easy: Reinstall with admin privileges.

Two suggestions for DAQFactory updates:

1) This can't be an unusual problem. I didn't have the issue on my Windows 7 machine because I had UAC turned off before I installed DAQFactory, but this probably can't be relied upon. Maybe the installer can verify full admin permissions before allowing the install to go forward. It does say "must be installed by an administrator," but that was technically true when I encountered the problem.

2) In order for the "virtualized registry" to have worked for writing the registry entry but NOT for reading it, it seems like there may be some discrepancy between them internally. Maybe some older/newer APIs being mixed or something.

Share this post


Link to post
Share on other sites

Great,  Thanks

 

Ran into the same problem. Right click on " run as administrater" when starting daqfactory, and was able to write to windows7 registry using  "Registry.strMyString = "data"" from the command line. 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this