Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 11:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Reading Registry Key into a Variable
PostPosted: May 17th, 2008, 11:39 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Hi Everyone,

I have a problem getting info from the Registry and writing it into a variable. I have just spent the past hour reading post from a search I did on this issue and never got it to work, though I did find lots of things I was doing wrong.

Here is the issue...

I have a hidden button on a page which does this.
On Show
Read data from registry

(Source)
Label
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","RegisteredOwner"

(Destination)
Variable
User

I have the variable named User on the page, and it should read the source into the destination. I read enough of the older posts where people were trying to deal with situations close to this and I've tried many variations, but can not get it to read who the RegisteredOwner is from the registry into my variable named User.

I have been in the registry to make sure that it does have a value of my name, and I'm trying to get a program to show who the owner is by trying to get that name to show up in that variable (User).

So what am I doing that is stupid? I feel it's probably minor that I'm over looking.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: PROBLEM SOLVED
PostPosted: May 18th, 2008, 12:14 am 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
This works...

User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")


Just had to try a little harder. :roll:

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 18th, 2008, 12:28 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
The registry actions can only read and write data from a publication specific registry key; not the general registry:

'Read Data from Registry Action' help page wrote:
This action can only be used if you have previously created a registry entry using the Write Data to Registry action.

As you have seen, if you need more complex registry access then you need to use the scripting version.

Glad you got it working.

_________________
ddww Opus Developer


For this message Duncan Lilly has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: PROBLEM SOLVED
PostPosted: May 23rd, 2008, 6:40 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Denn wrote:
This works...

User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")


Just had to try a little harder. :roll:


Denn, I am doing sort of the same thing at the moment and I am having problems. WHen you say "this works..." please elaborate how you setup your commands on the button please, I mean:

ON SHOW
Read data from registry
-Label: User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")

In registry for....
Current User only (is selected)

Destination
Variable USER

and then I am assuming you create a txt field and populate it with the USER variable to read the info.

Is this what you have done? Because I am doing the same and it is not working for me. Please advise.
Thanks

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


For this message Koala has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: PROBLEM SOLVED
PostPosted: May 23rd, 2008, 3:27 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Koala wrote:
Denn wrote:
This works...

User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")


Just had to try a little harder. :roll:


Denn, I am doing sort of the same thing at the moment and I am having problems. WHen you say "this works..." please elaborate how you setup your commands on the button please, I mean:

ON SHOW
Read data from registry
-Label: User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")

In registry for....
Current User only (is selected)

Destination
Variable USER

and then I am assuming you create a txt field and populate it with the USER variable to read the info.

Is this what you have done? Because I am doing the same and it is not working for me. Please advise.
Thanks

Koala,

What I did was this...
I created a hidden button on the page that has a command of "on show"
Then I chose Script (under programming)

In the script window I put this in verbatim. (don't put anything in front like, -Label:) use it just as I have it.
User = ReadRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" , "RegisteredOwner")

On the page I have a variable named "User"

Remember, this works on XP. I'm not sure about windows 2000, or Vista. I did a search on the internet and found where the information about the registered user of the machine is located. That is where I got the path information.

So this is what should happen. The page / screen is opened. The button is activated "On Show", The script is read and the information is placed into the variable.

If that doesn't work for you let me know. I'm at work and don't have everything in front of me. If the above does not work for you I will check everything when I get home and see if I've left anything out.

From what you showed me, I believe at this point your problem will be solved if you take "Label:" out of your script.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group