Announcement

Collapse
No announcement yet.

Reg Add command issue in the batch script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reg Add command issue in the batch script

    Hi, there!!
    I'm using Daniel Petri tip "Quickly Search The Web" for years and now I'm trying to customize windows 10 ltsb install.wim and add this option automatically to all users using batch script:

    Code:
    .................................
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl" /ve /f >nul 
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\Bb" /ve /d "http://info.babylon.com/cgi-bin/info.cgi?word=
    %s&lang=14&type=hp&layout=combo.html&n=10&list=" /f  >nul
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\ggl" /ve /d "http://www.google.com/search?q=%s" /f  >nul
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\evt" /ve /d "http://www.eventid.net/display.asp?eventid=%s" /f  >nul
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\img" /ve /d "http://images.google.com/images?hl=en&q=%s" /f  >nul
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\kb" /ve /d "http://support.microsoft.com/kb/%s" /f  >nul
    reg add "HKEY_USERS\%RegLoadPr%_NTUSER_\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\yh" /ve /d "http://search.yahoo.com/search?p=%s" /f  >nul
    ....................................
    I'm noticed that after windows 10 installation user cannot use quickly search the web options... and after checking the registry, I've foung that symbol "%" was removed for some reason during execution of reg add command. For instance, I've got default value in ggl key:

    Code:
    http://www.google.com/search?q=s
    Instead of:

    Code:
     http://www.google.com/search?q=%s
    When I'm using quickly search the web.reg file:

    Code:
    Windows Registry Editor Version 5.00 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl] 
    
     [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\Bb] 
     @="http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=" 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\evt] 
     @="http://www.eventid.net/display.asp?eventid=%s" 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\ggl] 
     @="http://www.google.com/search?q=%s" 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\img] 
     @="http://images.google.com/images?hl=en&q=%s" 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\kb] 
     @="http://support.microsoft.com/kb/%s" 
    
     [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\yh] 
     @="http://search.yahoo.com/search?p=%s"
    Everything working as expected... I've even tried batch script with those option only:

    Code:
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl" /ve /f 
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\Bb" /ve /d "http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=" /f  
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\ggl" /ve /d "http://www.google.com/search?q=%s" /f  
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\evt" /ve /d "http://www.eventid.net/display.asp?eventid=%s" /f  
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\img" /ve /d "http://images.google.com/images?hl=en&q=%s" /f  
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\kb" /ve /d "http://support.microsoft.com/kb/%s" /f  
    reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\SearchUrl\yh" /ve /d "http://search.yahoo.com/search?p=%s" /f
    And got the same result... If somebody know how to fix this issue it will be much appreciated...


  • #2
    I'm just completely guessing here but you could try "%%" - as the percent character is used in some scripting languages as "special purposes" so you need to tell it you REALLY want a "%"

    Let me know if it helps?


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

    Comment


    • #3
      You need to escape the "%" character. In this case it is the "%%".
      More info: http://www.robvanderwoude.com/escapechars.php
      Regards,
      Jeremy

      Network Consultant/Engineer
      Baltimore - Washington area and beyond
      www.gma-cpa.com

      Comment


      • #4
        Yes, this is it "%%" took effect!! Thanks both of you guys for useful advice's!!

        Comment

        Working...
        X