1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: How to write a batch file to amend a registry key??

Discussion in 'Software Development' started by lpool1, Apr 15, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. lpool1

    lpool1 Thread Starter

    Joined:
    Apr 15, 2010
    Messages:
    9
    That's worked andy :) thanks for your help. My mistake with the quotations. There is an option in the command prompt to overwrite the existing file. Is there something I can add to the code to automatically approve?

    Lpool1
     
  2. andythepandy

    andythepandy

    Joined:
    Jul 2, 2006
    Messages:
    367
    yes, just stick /f at the end of the line like:
    Code:
    reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components" /v DeskHtmlVersion /t REG_DWORD /d "0" /f
    
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    Good Job OutCaste
     
  4. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Don't forget to delete those two erroneous keys. You can do it from the Registry Editor, or the command line.
    Copy and paste these two lines into the Command Prompt, then press Enter (you can paste them both at once)
    Code:
    Reg Delete "HKCU\Software\Microsoft\Internet Explorer\Desktop\Components /v DeskHtmlVersion /t REG_DWORD /d 0" /F
    Reg Delete "HKCU\Software\Microsoft\Internet Explorer\Desktop\Components /v DeskHtmlVersion /t REG_DWORD /d 0x00000000" /F
    
    To paste into the Command Prompt, right click the Window, click Paste. If Quick Edit is enabled, the right click will paste immediately.
     
  5. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/917088