 |
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

May 14th, 2008, 05:59 AM
|
Authorized User
|
|
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
access and update the registry through asp
I want to access the Registy via classic asp, i want to find a key and update it ( I want to update the 'Play_Animations' key and set to yes) programmaitcally, so any one have any code/script to do this, or even an idea whats best way to do this.
__________________
Thank You
|

May 14th, 2008, 06:15 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
ASP does not have the ability to do this on a client. Nor does Javascript. You are going to need to write some sort of ActiveX / COM control that a user will have to install into their browser to get this type of functionality.
Personally, I have a serious problem with ANY control playing with my registry since a slight mistake can bring my entire system to its knees. This is not something I recommend doing.
-Doug
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
|

May 14th, 2008, 06:29 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Morning Imar.
Just to clarify for the OP: As Imar pointed out you can use VBS to execute commands against the registry but if you were to get the above code to work in an ASP page, the registry changes will occur on your server and not on the client. To achieve what you want to do you will need some sort of component as I pointed out OR you could create a VBS file as Imar noted and distribute that to users of your website. Now, I am no Anti-Virus expert but I imagine that a random VBS file that tries to access the Registry, and possibly a component for that matter, is probably going to trigger some response from the users Anti-Virus software flagging the action as being possibly malicious.
hth.
-Doug
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
|

May 14th, 2008, 06:35 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Nope, that's not what I meant:
<script type="vbscript">
' Registry code here
</script>
would execute on the *client* and therefore work with the client's registry. No need for an ActiveX file or a separate VBS file; just some pure client side script (and insanely lowered security settings, only suitable for an Intranet environment where you control the PCs in the network).
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|

May 14th, 2008, 06:39 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
O.o
Well I learned something today, albeit a bit frightening. Thanks for clarifing that Imar.
-Doug
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
|

May 14th, 2008, 07:59 AM
|
Authorized User
|
|
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks all.
would you have an example of code that could go in here:
<script type="vbscript">
' Registry code here
</script>
|

May 14th, 2008, 08:07 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
...That would be what the link Imar provided is for.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
|

May 14th, 2008, 08:09 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It's all in the first link I posted; that article shows the basic code required to write to the registry with VB Script.
Searching Google for things like WScript.Shell and RegWrite should give you more pointers and resources.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|

May 14th, 2008, 08:56 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
BTW: you may need slightly different script. Maybe you need CreateObject instead of Wscript.CreateObject for example. I am not 100% sure....
It's been many many years since I did this kind of scary and crazy stuff; however I think a Google search should give you more results.
Where are you going to use this? In an Intranet?
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|
|
 |