Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing the registry

Status
Not open for further replies.

howardnl

Programmer
Apr 12, 2001
18
US
Is there a way to edit the registry with ASP? I have been able to read registry values using wscript.shell, but I get an error when I try to update. It says "Invalid root in registry key." Could I be missing something? Based on user input I need to set a registry value. Thanks for any help.

Thanks,
Nick
 
Could it be that you're mixing up the client's registry with the server's registry? In other words, if your code to update the registry is running on the server, then the registry you're working on is the server's registry, and if the values you are attempting to set are based on the user's registry, that may be your problem.
 
Thanks for the reply. I wasn't very clear. Here's what I need to happen. The user comes to the page and selects an option from a dropdown list. When they submit their choice they should go to another page where based on the value that they selected, a registry value on the server should be set. I hope that makes sense (and it can be done). Thanks for any help. I appreciate it.

Thanks,
Nick
 
Based on the error you say you're getting, it sounds to me like the key you're trying to insert is incomplete - I believe it should contain the entire "path" from the root level down to and including the key you're setting.

What is the string that represents the key that you're passing to the function that updates the registry?
 
Hi.

howardnl is right. I've tried it as he wrote and I got same error message. When I've tried it in a simple html on the client side it worked properly, but when I tried in ASP, I got that message.
I'm looking after that.

regards, Kirilla
 
Hi,

I finally decided to join. Here's my code:

dim wshell
set wshell = server.createobject("wscript.shell")

'if i display the registry value it appears
response.write(wshell.regread("registry key"))
'now i want to update the same value that i just displayed
'with something the user entered
'i thought this was how, but so far it looks like i'm wrong
wshell.regwrite "registry key", "value"

I thought that would work, but I was obviously wrong. Thanks again for your help.

Nick
 
Hi,

I've been searching this forum for an answer to my question and this was the closest thread to it that I could find. Unfortunately it doesn't seem that it was ever answered :_(

I too am trying to edit the server's registry and failing. Is anyone aware of any issues regarding this specific to ASP, perhaps some sort of security setting in Windows (XP at the mo.)

Thanks for any answers...

-BoB
 
Check the VBScript forum, they should have some answers for this already.

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
minilogo.gif alt=tiernok.com
The never-completed website
 
Thanks,

I actually have some code that works when used in a VB exe but fails in ASP. What I've done is build an ActiveX DLL that reads from / writes to the registry. This DLL functions correctly when part of the exe, but mysteriously fails to write to the registry when created with

Reggy = Server.CreateObject("GroovyRegistryTool.Thingy").

I'm sure that the object is being created correctly however, as it does return current registry settings when asked.

What is it about doing it from ASP that causes problems? The means of writing to the registry is via a property on the object, e.g.

Reggy.RegistryVal = "NewValue"

ANy pointers as to why this should fail only in ASP would be gratefully accepted...

-BoB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top