Reg Add command issue in the batch script

Home Forums Scripting General Scripting Reg Add command issue in the batch script

This topic contains 3 replies, has 3 voices, and was last updated by  igor7 1 year, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts

  • igor7
    Member
    #167167

    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:

    ……………………………
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_SOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f >nul
    ………………………………
    [/CODE]

    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[/CODE]

    Instead of:

    [CODE] http://www.google.com/search?q=%5BCOLOR=#FF0000%5D%%5B/COLOR%5Ds%5B/CODE%5D

    When I’m using quickly search the web.reg file:

    [CODE]Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl]

    [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchUrlBb]
    @=”http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt]
    @=”http://www.eventid.net/display.asp?eventid=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl]
    @=”http://www.google.com/search?q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg]
    @=”http://images.google.com/images?hl=en&q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb]
    @=”http://support.microsoft.com/kb/%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh]
    @=”http://search.yahoo.com/search?p=%s”[/CODE]

    Everything working as expected… I’ve even tried batch script with those option only:

    [CODE]reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    [CODE]……………………………
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_SOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f >nul
    reg add “HKEY_USERS%RegLoadPr%_NTUSER_SOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f >nul
    ………………………………
    [/CODE]

    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:

    http://www.google.com/search?q=s%5B/CODE%5D

    Instead of:

    [CODE] http://www.google.com/search?q=%5BCOLOR=#FF0000%5D%%5B/COLOR%5Ds%5B/CODE%5D

    When I’m using quickly search the web.reg file:

    [CODE]Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl]

    [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchUrlBb]
    @=”http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt]
    @=”http://www.eventid.net/display.asp?eventid=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl]
    @=”http://www.google.com/search?q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg]
    @=”http://images.google.com/images?hl=en&q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb]
    @=”http://support.microsoft.com/kb/%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh]
    @=”http://search.yahoo.com/search?p=%s”[/CODE]

    Everything working as expected… I’ve even tried batch script with those option only:

    [CODE]reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    [CODE]http://www.google.com/search?q=s[/CODE]

    Instead of:

    http://www.google.com/search?q=%5BCOLOR=#FF0000%5D%%5B/COLOR%5Ds%5B/CODE%5D

    When I’m using quickly search the web.reg file:

    [CODE]Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl]

    [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchUrlBb]
    @=”http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt]
    @=”http://www.eventid.net/display.asp?eventid=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl]
    @=”http://www.google.com/search?q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg]
    @=”http://images.google.com/images?hl=en&q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb]
    @=”http://support.microsoft.com/kb/%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh]
    @=”http://search.yahoo.com/search?p=%s”[/CODE]

    Everything working as expected… I’ve even tried batch script with those option only:

    [CODE]reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    [CODE] http://www.google.com/search?q=%s[/CODE]

    When I’m using quickly search the web.reg file:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl]

    [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchUrlBb]
    @=”http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt]
    @=”http://www.eventid.net/display.asp?eventid=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl]
    @=”http://www.google.com/search?q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg]
    @=”http://images.google.com/images?hl=en&q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb]
    @=”http://support.microsoft.com/kb/%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh]
    @=”http://search.yahoo.com/search?p=%s”[/CODE]

    Everything working as expected… I’ve even tried batch script with those option only:

    [CODE]reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    [CODE]Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl]

    [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchUrlBb]
    @=”http://info.babylon.com/cgi-bin/info.cgi?word=%s&lang=14&type=hp&layout=combo.html&n=10&list=”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt]
    @=”http://www.eventid.net/display.asp?eventid=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl]
    @=”http://www.google.com/search?q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg]
    @=”http://images.google.com/images?hl=en&q=%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb]
    @=”http://support.microsoft.com/kb/%s”

    [HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh]
    @=”http://search.yahoo.com/search?p=%s”[/CODE]

    Everything working as expected… I’ve even tried batch script with those option only:

    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    [CODE]reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrl” /ve /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlBb” /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_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlggl” /ve /d “http://www.google.com/search?q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlevt” /ve /d “http://www.eventid.net/display.asp?eventid=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlimg” /ve /d “http://images.google.com/images?hl=en&q=%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlkb” /ve /d “http://support.microsoft.com/kb/%s” /f
    reg add “HKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerSearchUrlyh” /ve /d “http://search.yahoo.com/search?p=%s” /f[/CODE]

    And got the same result… If somebody know how to fix this issue it will be much appreciated…

    #220895

    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?


    JeremyW
    Moderator
    #271562

    You need to escape the “%” character. In this case it is the “%%”. :)
    More info: http://www.robvanderwoude.com/escapechars.php


    igor7
    Member
    #295083

    Yes, this is it “%%” took effect!! Thanks both of you guys for useful advice’s!!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.