forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


REGREAD is killing me or Im just stupid

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Fri Nov 17, 2006 3:21 pm    Post subject: REGREAD is killing me or Im just stupid Reply with quote

OK let me first say that I am probably missing something stupid here.
I am trying to do regreads and prior to today everything is working fine with it. The script that I have is similar to this.

Code:

%%root = "HLM"
%%subkey = "SOFTWARE\Policies\Update\Test"
%%key = "Testkey"
%%value = @regread(%%root@chr(44)%%subkey@chr(44)%%key@chr(44))



For the life of me I cannot get it to work. The only way I can get it to work is to type out each and every registry setting that im looking for. Basically im feeding a list of keys and having the program give me the results.

Any help would be appreciated.

WD

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Nov 17, 2006 3:31 pm    Post subject: Reply with quote

Webdaddy,
You can't do what your trying to do. Your breaking VDS rules Wink VDS will treat your code as a single parameter. I don't know why but it has always been that way. My guess is that the runtime makes it a literal string before passing it to the function (ie...with quotes around it "%%root,%%subkey,%%key,"). Replace the @chr(44) with the actual character.

Code:

%%root = "HLM"
%%subkey = "SOFTWARE\Policies\Update\Test"
%%key = "Testkey"
%%value = @regread(%%root,%%subkey,%%key,)

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Fri Nov 17, 2006 7:08 pm    Post subject: Reply with quote

That definitely didnt work.

I dont think regread can read variable passed to it.
The ONLY way I can get it to work is if I hard code it and that will defeat the purpose in writing this program as I already have it doing that. Thank you for the suggestion. Hoping we can figure out what is actually happening here. It could be a bug as I tried passing variables to most of the other functions and it works fine. Its just the regread that is giving me a problem.

Again thanks.

WD

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Nov 17, 2006 9:31 pm    Post subject: Reply with quote

Webdaddy,
It works here on Windows XP SP2 and VDS 5.02 Question Have you checked your permissions?

Code:

%%root = "HLM"
%%subkey = "SOFTWARE\Policies\Update\Test"
%%key = "Testkey"
%%value = @regread(%%root,%%subkey,%%key,)

Info %%value@CR()


Take a look at the attached ScreenShot... Sorry for the large image but I could not show it any other way Confused



regreadtst.jpg
 Description:
ScreenShot of @regread() working...
 Filesize:  187.24 KB
 Viewed:  17332 Time(s)

regreadtst.jpg



_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Nov 17, 2006 10:13 pm    Post subject: Reply with quote

I just tried here, with XP SP2 and VDS 5.02 and it seems you need to be logged into an account with admin rights. Run-As admin & power user accounts seem unable to read HLM with VDS.

EDIT It still wouldn't read HLM even when I logged into an admin account!

_________________
cheers

Dave
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Nov 17, 2006 11:25 pm    Post subject: Reply with quote

That's not right. There is an issue with LIST REGVALS and LIST REGKEYS under non-admin accounts which I mentioned a couple of weeks ago, but @regread does not have this problem in VDS 5 if not earlier.

However, it has always been possible under Windows to set more specific permissions on registry keys that could deny access even to administrators in general. As you're trying to read security related items I guess that is the reason. VDS does not have the capability to set the access rights required as finely as you can using the API.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Sat Nov 18, 2006 11:15 pm    Post subject: Reply with quote

Fixed
I fixed this by finally using @string to parse my values and then using parse to parse the individual parts of the registry key. I also tried using a hidden run command to run reg.exe and get the results back to VDS using @pipe which also worked but found that the problem had to be some hidden character or something that was screwing up the registry reads. I will post the finished code shortly.

WD

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Sun Nov 19, 2006 12:13 am    Post subject: Reply with quote

Nice to hear it working Smile Check if the @chr(44)'s are causing the problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group