Wrox Programmer Forums
|
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
 
Old May 14th, 2008, 05:59 AM
Authorized User
 
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default 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
 
Old May 14th, 2008, 06:15 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
 
Old May 14th, 2008, 06:19 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not entirely true; you can use VB Script for this:

http://windowsitpro.com/article/arti...-vbscript.html

However, it also means users will have to lower their security settings in order to allow this....

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.
 
Old May 14th, 2008, 06:29 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
 
Old May 14th, 2008, 06:35 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old May 14th, 2008, 06:39 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
 
Old May 14th, 2008, 07:59 AM
Authorized User
 
Join Date: Nov 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

thanks all.
would you have an example of code that could go in here:
<script type="vbscript">
' Registry code here
</script>
 
Old May 14th, 2008, 08:07 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...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
================================================== =========
 
Old May 14th, 2008, 08:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old May 14th, 2008, 08:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
remote registry access alex_smotritsky General .NET 2 November 28th, 2007 02:53 AM
how to edit and update my access db using asp.net method ASP.NET 1.0 and 1.1 Basics 4 April 25th, 2005 03:03 PM
Update asp-access to mysql karib Classic ASP Databases 3 November 30th, 2003 01:44 PM
Can't update Access database under ASP with ADO bnorg ASP.NET 1.0 and 1.1 Basics 6 September 16th, 2003 02:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.