Can we use Jscript to read/write to Windows Regist

Results 1 to 5 of 5

Thread: Can we use Jscript to read/write to Windows Regist

  1. #1
    Joe Chahine Guest

    Default Can we use Jscript to read/write to Windows Regist

    Can we use Javascript/Jscript to read/write the Windows Registry?<BR><BR>Thanks,<BR>JOE CHAHINE<BR>Dearborn, MI

  2. #2
    Join Date
    Dec 1969

    Default RE: Can we use Jscript to read/write to Windows Re

    Not directly. If you are wanting to read or write to the registry of the web server then you need a component that you can call from a page to manipulate it. Microsoft has one available on their site that they give away for free at:<BR><BR><BR><BR>If you&#039re trying to read from or write to the registry of client machines then you&#039re on your own. That&#039s very scary business and can get users ticked off in a hurry. Usually you&#039ll have to download an Active X control to their machine to do that and most people have "Allow Active X controls to be downloaded" turned off in their browser. The other option is to have a link to a .reg file on your site and tell users to click the link and choose "Open this file from its current location" (In IE) to run the .reg file and update the registry that way.

  3. #3
    Joe Chahine Guest

    Default RE: Can we use Jscript to read/write to Windows Re

    Joel, as you mentioned, I found that Windows Script Hosting has an ActiveX control that allows me to do what I&#039m trying to accomplish (drive mappings, etc). Our corporate standard browser settings are to allow the ActiveX download and I think it&#039ll be fine with the users.<BR><BR>I can run the ActiveX object code (JS) from the desktop with WSH, but I would like to embed it into my HTML instead. Do you know how to accomplish this? I just get a "Done with errors" message when I try it.<BR><BR>In other words, I want to access non-native JScript objects, methods, properties, etc. within HTML pages browsed by IE. I can&#039t find any info on how to get IE to recognize the objects. WSH has no problem with it on the desktop.<BR><BR>Gratefully Yours, <BR>JOE CHAHINE<BR>at Ford Motor Company

  4. #4
    Joel Nelson Guest

    Default RE: Can we use Jscript to read/write to Windows Re

    First, I have one question -- if you are allowing Active X controls to be downloaded then you&#039re using IE, in which case you could use VBScript on the client. You&#039re only stuck with JavaScript on the client if you have to be cross-browser compatible.<BR><BR>As far as using the control on the client, you need to use an &#060;OBJECT&#062; tag in your html page to create the component, then script the properties and methods of the object with your javascript. In the scenario you&#039ve described you can use the same component that MS gives away free. If the user hits that page and doesn&#039t already have that component on their machine it will have to download it before the script will run. <BR><BR>With ActiveX controls running on the client you don&#039t have to write these as ASP pages, you can put them in .html files and they&#039ll work just fine since the executable code is actually on the client&#039s machine, not on the server.<BR><BR>Check some Microsoft sample code where they create and use Active X controls in web pages. I think you&#039ll get the hang of it if you investigate a little. If you MUST use JavaScipt even though you&#039re in IE you&#039ll have to do the VBScript to JavaScript translation of most of their sample code but that&#039s a good exercise to do if for no other reason than to sharpen your scripting skills.

  5. #5
    Joe Chahine Guest

    Default RE: Can we use Jscript to read/write to Windows Re

    Joel,<BR>You are correct that I am using IE but for various reasons I am using Javascript instead of VBScript. Mainly because I will be writing a routine for Netscape using Javascript and so I need to learn it.<BR>I will try the techniques that you outlined, such as the &#060;OBJECT&#062; tag. Thanks again and have a good Holiday.<BR>Regards,<BR>JOE CHAHINE<BR>at Ford Motor Company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts