Solved

access registry and loop through add/remove programs

Posted on 2006-06-12
11
564 Views
Last Modified: 2013-11-18
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
Comment
Question by:ellandrd
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 10

Expert Comment

by:ClickCentric
ID: 16887302
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
 
LVL 16

Author Comment

by:ellandrd
ID: 16887353
>>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
 
LVL 4

Accepted Solution

by:
recklez earned 500 total points
ID: 16887556
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 10

Expert Comment

by:ClickCentric
ID: 16887592
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
 
LVL 16

Author Comment

by:ellandrd
ID: 16888622
>>such things are best avoided

pitty as its a requirement and i need to know how to do it...
0
 
LVL 16

Author Comment

by:ellandrd
ID: 16888638
the code in the Micro$lop URL - how can i run this?  im not familar with ASP or VB?
0
 
LVL 10

Expert Comment

by:ClickCentric
ID: 16888825
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
 
LVL 23

Expert Comment

by:basicinstinct
ID: 16888922
linux doesn't have a registry - do you wish to restrict your users to microsoft only?
0
 
LVL 5

Expert Comment

by:Jojo1771
ID: 16891408
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
 
LVL 16

Author Comment

by:ellandrd
ID: 16892051
>>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
 
LVL 5

Expert Comment

by:Jojo1771
ID: 16917375
You don't know what a user control is. Are you sure you program in .Net?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i test my code? 1 33
how i fix Remove render-blocking JavaScript 3 50
simple javascript form validation 2 17
how can i check if the text is an Isogram ? 2 24
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 discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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)

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now