Jump to content

Windows 7/ LabVIEW's Registry Writing VIs


Recommended Posts

Hi Guys

This is not really a LabVIEW problem, but more a Windows 7/ LabVIEW's Registry Writing VIs.

My LabVIEW application updates the Registry, to link a File-Extension to a exe-file.

I do this by adding some keys under the: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\

It works in XP, but now with Vista and Win7, I get permission denied from the Registry VIs.

Err=-604,Remote registry access denied

Does anybody know how to solve this?

Ilike my LV applications to check if it has been modified when it starts andupdate it if needed.

Different LV applications should be able to relink the same file-extension to different targetexe-files.

I can manually change the permission in the registry but I don't want all users to need to do that.

Cheers,

Mike

Link to comment

It sounds like your LV application is not running with Administrator permissions. Since Windows Vista, access to certain disk folders, as well as a few registry keys (including HKEY_LOCAL_MACHINE), has been restricted to improve security.

If your LV application is compiled into an EXE, try right-clicking on the EXE file in Explorer and selecting "Run as Administrator". Otherwise, I think you'll have to do that with LabVIEW itself, and run your application in this copy of LabVIEW runnign with Administrator permissions.

I hope this helps!

(See also Wikipedia's "User Account Control" topic)

Link to comment

I recently found out that LabVIEW can read the registry without needing higher privileges. When you do your first Registry Open there is a method enum which by default is Write and Read. If you only need to read set it to Read and you won't get permission errors. But yeah since you will likely need to write the registry you will need to run the program with higher privileges.

  • Like 1
Link to comment

Can you set it for the "Current User"? When I updated my applications for Win7, I moved my registry setting from "Local Machine" to "Current User" to fix permission problems.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions

Link to comment

Does anybody know how to solve this?

Ilike my LV applications to check if it has been modified when it starts andupdate it if needed.

You can turn off the UAC and that should allow you to write, but then you're running without the UAC. There is a meathod to request enhanced permissions (not sure if that's the actual name for it) which allows you to temporarily modify the registry, files in Program Files, etc. I'm not sure what's involved, but that's where I got to when I decided it would be easier (and save some of what little sanity I have) to put a flag in the code to switch where values were stored based on XP or Win7.

Tim

Link to comment

Thanks for the feedback guys

I followed your examples:

Can you set it for the "Current User"? When I updated my applications for Win7, I moved my registry setting from "Local Machine" to "Current User" to fix permission problems.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions

and used HKEY_CURRENT_USER\SOFTWARE\Classes\

And now it works again :-)

Cheers,

Mikae

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.