client registry access via JavaScript

Is it possible to access a client workstation registry key value via JavaScript through the web?

If so, how?

thanks
kbweslerAsked:
Who is Participating?
 
CJ_SCommented:
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
 
CJ_SCommented:
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
 
CJ_SCommented:
There might be another way to achieve your goals.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
lexxwernCommented:
i dont think so. not that i know what you mean, but i just have never come across this, <grin>
0
 
lexxwernCommented:
which registry are we talking abt here?
0
 
kbweslerAuthor Commented:
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
 
CJ_SCommented:
Why do you want to do that? What results would you like to achieve?

CJ
0
 
CJ_SCommented:
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
 
kbweslerAuthor Commented:
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
 
kbweslerAuthor Commented:
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
 
CJ_SCommented:
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
 
kbweslerAuthor Commented:
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
 
CJ_SCommented:
This is the only way that you won't get the anti-virus software in between btw, other methods using javascript will!!

CJ
0
 
kbweslerAuthor Commented:
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
 
kbweslerAuthor Commented:
thank you exactly what I was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.