?
Solved

client registry access via JavaScript

Posted on 2002-06-05
15
Medium Priority
?
761 Views
Last Modified: 2012-06-27
Is it possible to access a client workstation registry key value via JavaScript through the web?

If so, how?

thanks
0
Comment
Question by:kbwesler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
15 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 7056948
Of course you cannot access the registry with javascript when it came through the web. This is due to security reasons. The only way to do that is when the user explicitly allows you to do that. otherwise it is not possible.

And believe me, users won't allow you to do that.

You are able to do that with ActiveX but due to the vulnerability I won't give you that code...

Why exactly would you want that?

CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7056950
There might be another way to achieve your goals.
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7056953
i dont think so. not that i know what you mean, but i just have never come across this, <grin>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:lexxwern
ID: 7056956
which registry are we talking abt here?
0
 

Author Comment

by:kbwesler
ID: 7057080
so the user has to enable active scripting within the browser? is there any other way to pull values from a client registry via a scripting language?
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7057104
Why do you want to do that? What results would you like to achieve?

CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7057111
The user has to enable your website to do that. And it will only work in Internet Explorer and not on AOL or Netscape.

In IE the user will be prompted with a security warning and can then choose whether to allow you or not.

0
 

Author Comment

by:kbwesler
ID: 7057142
I have an application which runs in a LAN that saves preferences locally to the client workstation registry.  Then I have a web component to the app that needs to access those registry settings. There has to be a way to achieve this.
0
 

Author Comment

by:kbwesler
ID: 7057155
I have an application which runs in a LAN that saves preferences locally to the client workstation registry.  Then I have a web component to the app that needs to access those registry settings. There has to be a way to achieve this.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7057171
You really should be using cookies for that purpose and not the registry, that is what they are for.

Okay, so you alreayd have an application? Is it a component? Like ActiveX? If so, the easiest way to achieve your goals is by adding this registry writing to that application and allow that application to run on the client. You cannot tell the application to write or read from a certain client without having the application run on that client (makes sense?).

Cookies are the way to do your stuff from a browser on.

I still don't really get the design that you are using. So I would like to ask some questions.

1) Is it a webinterface? With other words is a page being opened on the client?
2) Does it really have to be registry? I don't recommend it for this purpose, instead you should use cookies.
3) is the web application a true component or plain HTML / Javascript?

CJ
0
 

Author Comment

by:kbwesler
ID: 7057181
cookies are not an option.  It is a web interface and it is only a component or portal to the client/server application.  The preferences that are stored in the registry are different for every workstation.  Yes, it has to access the registry.
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 800 total points
ID: 7057231
Here is a small example. I hope you can understand that I don't like to give away code like this, since it can harm someone's computer, therefore I only give you the read code.

<html>
 <head>
 </head>

 <body>
 <script language="VBScript">

Function RegistryRead(KeyName, ValueName)
  Set WshShell = CreateObject("WScript.Shell")
  RegistryRead = WSHShell.RegRead(KeyName & "\" & ValueName)
End Function

Msgbox RegistryRead("HKEY_CURRENT_USER", "Software\Microsoft\Internet Explorer\Download Directory")

  </script>

 </body>

</html>
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7057234
This is the only way that you won't get the anti-virus software in between btw, other methods using javascript will!!

CJ
0
 

Author Comment

by:kbwesler
ID: 7057235
cookies are not an option.  It is a web interface and it is only a component or portal to the client/server application.  The preferences that are stored in the registry are different for every workstation.  Yes, it has to access the registry.
0
 

Author Comment

by:kbwesler
ID: 7057241
thank you exactly what I was looking for.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question