-
January 28th, 2010, 07:40 PM
#1
reading registry
Hello,
I'm trying to make a command button that starts application that has it's
relative location written in registry (HKLM\SOFTWARE\Wow6432Node\...\DirIns,
DirIns being REG_SZ).
Anyone kind enough to provide proper code?
Thanks in advance.
-
January 28th, 2010, 11:49 PM
#2
Re: reading registry
That would require ADMINISTRATIVE permission, and you can't program that, if that's your question. Is that Windows 7, or Vista?
-
January 29th, 2010, 07:32 AM
#3
Re: reading registry
Well, I'm using XP64 but I don't see why would reading a registry key require admin rights
or be OS dependant (apart from addition of 'wow6432node' in 64bit OS).
Basically what I'm trying to read out from registry is the installation path written by setup
from a string value, which I'd then append in ShellExecute or Shell command - something
like:
whatimlookingfor = path as string
Shell("path\*.exe")
Is that doable?
-
January 29th, 2010, 07:57 AM
#4
Re: reading registry
It should be.
Look at this page http://allapi.mentalis.org/apilist/r.shtml
Read the RegOpenKeyEx() and RegQueryValueEx() descriptions. Look at the sample how you read a registry key.
Another idea is to use the scripting host:
Code:
Dim wsh As Object
Dim Result as String
Set wsh = CreateObject("WScript.Shell")
Result = wsh.RegRead(KeyString)
KeyString must be the full registry path to the desired value.
If this is a valid file path you can Shell Result & "\filename.exe"
But David might be right with the administrative permissions. I'm not sure, I'm always administrator on my computers.
Last edited by WoF; January 29th, 2010 at 07:59 AM.
-
January 29th, 2010, 08:37 AM
#5
-
January 29th, 2010, 07:06 PM
#6
Re: reading registry
Powershell 2.0 is the call for DOS-like Scripting on XP+ systems
http://technet.microsoft.com/en-us/s.../dd742419.aspx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|