| View previous topic :: View next topic |
| Author |
Message |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri Nov 17, 2006 3:21 pm Post subject: REGREAD is killing me or Im just stupid |
|
|
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 |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Nov 17, 2006 3:31 pm Post subject: |
|
|
Webdaddy,
You can't do what your trying to do. Your breaking VDS rules 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 |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri Nov 17, 2006 7:08 pm Post subject: |
|
|
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 |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Fri Nov 17, 2006 10:13 pm Post subject: |
|
|
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 |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Nov 17, 2006 11:25 pm Post subject: |
|
|
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 |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sat Nov 18, 2006 11:15 pm Post subject: |
|
|
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 |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Sun Nov 19, 2006 12:13 am Post subject: |
|
|
Nice to hear it working Check if the @chr(44)'s are causing the problem.
|
|
| Back to top |
|
 |
|