|
Subject:
|
access and update the registry through asp
|
|
Posted By:
|
Hughesie78
|
Post Date:
|
5/14/2008 5:59:40 AM
|
|
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.
|
|
Reply By:
|
dparsons
|
Reply Date:
|
5/14/2008 6:15:19 AM
|
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 ===========================================================
|
|
Reply By:
|
Imar
|
Reply Date:
|
5/14/2008 6:19:22 AM
|
Not entirely true; you can use VB Script for this:
http://windowsitpro.com/article/articleid/85512/jsi-tip-10305-how-can-i-write-the-registry-using-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.
|
|
Reply By:
|
dparsons
|
Reply Date:
|
5/14/2008 6:29:34 AM
|
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 ===========================================================
|
|
Reply By:
|
Imar
|
Reply Date:
|
5/14/2008 6:35:43 AM
|
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.
|
|
Reply By:
|
dparsons
|
Reply Date:
|
5/14/2008 6:39:07 AM
|
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 ===========================================================
|
|
Reply By:
|
Hughesie78
|
Reply Date:
|
5/14/2008 7:59:04 AM
|
thanks all. would you have an example of code that could go in here: <script type="vbscript"> ' Registry code here </script>
|
|
Reply By:
|
dparsons
|
Reply Date:
|
5/14/2008 8:07:55 AM
|
...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 ===========================================================
|
|
Reply By:
|
Imar
|
Reply Date:
|
5/14/2008 8:09:00 AM
|
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.
|
|
Reply By:
|
Imar
|
Reply Date:
|
5/14/2008 8:56:03 AM
|
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.
|
|
Reply By:
|
Hughesie78
|
Reply Date:
|
5/15/2008 5:55:19 AM
|
sorry i see that link now. yes its across an intranet looking at DW reports.
|
|
Reply By:
|
Hughesie78
|
Reply Date:
|
5/16/2008 4:38:13 AM
|
i have a .reg file, i want this to be executed from a web page is this possible?
|
|
Reply By:
|
Imar
|
Reply Date:
|
5/16/2008 6:19:09 AM
|
You might be able to do this with the Run method of the Shell object:
http://customerfx.com/pages/crmdeveloper/2004/02/10/331.aspx
However, I think your users need very low security settings and probably need to confirm the operation...
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.
|