Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

access registry and loop through add/remove programs

i can create active x objects to access registry and display information like the version of your Java plugin etc etc.

first - where can i find the list of software that is displayed in add/remove programs?
second - how can i loop through this list and display it?

my code:

<script language="JavaScript">
<!--
var activeXDisabled = false;
var shell;

try
{
      shell = new ActiveXObject("WScript.Shell");

      if (shell != null)
      {
            try
            {
document.writeln(shell.regRead("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"));
            }
            catch(e)
            {
            }
      }
}
catch(e)
{
      activeXDisabled = true;
}
//-->
</script>
0
ellandrd
Asked:
ellandrd
  • 4
  • 3
  • 2
  • +2
1 Solution
 
ClickCentricCommented:
Accessing the system registry through a webpage...only microsoft would ever even dream of allowing something like that.  However, this would fail as often as it may work because it's ActiveX.  If your goal is really to determine the java plugin version, take a look at:

http://forum.java.sun.com/thread.jspa?threadID=168544&tstart=60

It covers cross-browser compatible methods.
0
 
ellandrdAuthor Commented:
>>like the version of your Java plugin etc etc.

was an example and i can do this... i was looking to loop throught the registry and display values.

at the moment, im only able to display 1 value - the java plugin value...  how can i loop through current installed software list and output the list to webpage?
0
 
recklezCommented:
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!

 
ClickCentricCommented:
You can do this...if someone's using IE and has ActiveX enabled and has no security implements in place to prevent it...which is becoming less and less common.  If you want to create a site that really works, such things are best avoided.  
0
 
ellandrdAuthor Commented:
>>such things are best avoided

pitty as its a requirement and i need to know how to do it...
0
 
ellandrdAuthor Commented:
the code in the Micro$lop URL - how can i run this?  im not familar with ASP or VB?
0
 
ClickCentricCommented:
Perhaps it would help if you told us your real goal as there are other, better, cross-browser compatible ways to determine the version of the java plugin.  There are likely better ways to do whatever else you want to do as well since treading the registry via javascript is not something that even Microsoft is likely to allow much longer.  
0
 
basicinstinctCommented:
linux doesn't have a registry - do you wish to restrict your users to microsoft only?
0
 
Jojo1771Commented:
If this is for an intranet. I would recommend the use of a windows user control that loads as a Object in yuor html. This is a better approach. It requires that you set some security settings in your 2.0 or 1.1 . net secuirty config. But once its done you can create a msi off the settings and drop it in your domains login script. If this is for an internet site. I must agree with the others, in stating that there must be a better way.

Anwyas

1) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

2) Simply open the containing key and loop thru the sub keys looking at the displayname.

0
 
ellandrdAuthor Commented:
>>Perhaps it would help if you told us your real goal as there are other, better, cross-browser compatible ways to >>determine the version of the java plugin.

will people read my comments for christ sake! i said i can *get* the java plugin version.  plus this was an example of what i can do *already* and not what i want to achieve!

my *main* goal is to list the installed software on the clients machine for use in our intranet as stated in my opening comment!!!!

>>linux doesn't have a registry - do you wish to restrict your users to microsoft only?

i already know this and this is a WINDOWS/Microsoft questions.

>>If this is for an intranet. I would recommend the use of a windows user control that loads as a Object in yuor html. >>This is a better approach. It requires that you set some security settings in your 2.0 or 1.1 . net secuirty config.

I dont understand you??

>>Simply open the containing key and loop thru the sub keys looking at the displayname.

I dont know how to loop through it?  example?

again as stated in my opening comment my code is as follows, but i dont know how to loop through that directory and display each value for each piece of software installed...

<script language="JavaScript">
<!--
var activeXDisabled = false;
var shell;

try
{
     shell = new ActiveXObject("WScript.Shell");

     if (shell != null)
     {
          try
          {
document.writeln(shell.regRead("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"));
          }
          catch(e)
          {
          }
     }
}
catch(e)
{
     activeXDisabled = true;
}
//-->
</script>
0
 
Jojo1771Commented:
You don't know what a user control is. Are you sure you program in .Net?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now