Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    806
    Thanks
    42
    Thanked 6 Times in 5 Posts

    running a .reg file from a webpage

    I understand that this is not the done thing for security reasons, but these particular pages of mine are not for general consumption.

    I have a .reg file that I would like to access from a link in a webpage. In IE you can do an onclick and it will ask if you want to run (or save) the file.

    Code:
    onclick="location.href='http://my.com/addtoregistry.reg';"
    But in other browsers (FF and Chrome for example) the onclick brings up a new tab with the contents of the .reg file.

    Is there a way to make these other browsers also prompt to run the file?
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    add a download attrib to a link pointing to the reg file, the name of the file as you want it saved locally, download='addtoregistry.reg' to trigger a save instead of navigation in FF and chrome, while the <a> tag itself lets a user save as in older browsers.
    Last edited by rnd me; 06-09-2013 at 07:50 AM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,274
    Thanks
    28
    Thanked 271 Times in 265 Posts
    Quote Originally Posted by tpeck View Post
    Is there a way to make these other browsers also prompt to run the file?
    Using rnd me's suggestion:

    Firefox will recognize the file as an ordinary text file and you'll need to manually navigate to regedit.exe, and then click "OK" to run the file. Firefox will remember which application you used to open a file type last, so simply clicking "OK" will work after that.

    Chrome prompts you to save the file with a "Save As" dialog after which point you'll need to click the download tile at the bottom of the window to open the file. If you activate "Always open files of this type" in the tile options menu (which is accessed from the arrow button at the right of the tile), Chrome will instead ask you if you want to "Keep" or "Discard" the file without bothering you with the "Save As" dialog. Clicking "Keep" will run the file.

    In Opera (Opera Next 15), the file will automatically be downloaded. You can run the file by double-clicking the tooltip that appears at the top right of the screen after the file has been downloaded or by opening the Downloads panel (through the toolbar button, Opera menu, or by pressing Ctrl+J) if the tooltip disappears on you.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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