Question

  • Creator
    Topic
  • #2158130

    Batch / Scripting Problem

    Locked

    by lowryda ·

    Hi I have an issue with a batch file I have created for the purpose of setting the homepage (googlehome.bat) as below:


    @echo
    off
    set key=HKCU\Software\Microsoft\Internet Explorer\Main
    set value=Start page
    set data=%1
    reg.exe add “%key%” /v “%value%” /d “%data%” /f
    googlehome “http://www.google.com.au”

    When run the home page sets to google correctly however the batch seems to remain stuck in a loop with “The Operation completed successfully” continuosly repeating on the screen.
    Any advice would be appreciated I am not much of script/batch junkie.

All Answers

  • Author
    Replies
    • #2772792

      Clarifications

      by lowryda ·

      In reply to Batch / Scripting Problem

      Clarifications

    • #2772791

      Try a goto

      by rob miners ·

      In reply to Batch / Scripting Problem

      set key=HKCU\Software\Microsoft\Internet Explorer\Main
      set value=Start page
      set data=%1
      reg.exe add “%key%” /v “%value%” /d “%data%” /f
      googlehome “http://www.google.com.au”
      goto end
      :end

    • #2772710

      It’s calling itself

      by bizzo ·

      In reply to Batch / Scripting Problem

      Looks like the reason it’s stuck in a loop is because it’s calling itself (see the last line). You’d be better off setting the data with the address rather than using a parameter, like this:


      @echo
      off
      set key=HKCU\Software\Microsoft\Internet Explorer\Main
      set value=Start page
      set data=http://www.google.com.au
      reg.exe add “%key%” /v “%value%” /d “%data%” /f

      • #2992674

        This worked

        by lowryda ·

        In reply to It’s calling itself

        Tried other suggestions from other users, this was the only one that worked. Thank you

    • #2993001

      put in an exit

      by maxpowers410 ·

      In reply to Batch / Scripting Problem

      Why not try and put an exit command in at the end?
      That way it should just close the cmd when its finished.
      goto end
      :end
      exit

Viewing 3 reply threads