How to set Internet options without UI ?


  1. Posts : 16
    64 bits Windows 10 home
       #1

    How to set Internet options without UI ?


    Hello there !
    I try to configure Internet options (inetcpl.cpl) for my computer and I would like to do it with command lines, PS scripts or registry tweak... Actually, without any user interaction, only by scripting !

    Here is what I know :
    - it is possible to remove or block some tabs of the Internet options by writting in HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel (or HKLM for all users) [link] [link]
    - it is possible to open a specific tab of Internet options by running RunDll32.exe Shell32.dll,Control_RunDLL InetCpl.cpl [link]
    - it is also possible to clear navigation data by running RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess [link]

    Is there a way to set values, to check boxes, to uncheck boxes by running RunDll32.exe or by changing registry ? I don't know anything about DLLs and entrypoints.. So your help would be very useful ! Or maybe with a VBscript ?

    Here is what I would like to configure in the "General" tab :
    - change the home page (picture 1)
    - check "Delete history when exiting the browser" (picture 1)
    Then, in "settings" :
    - change the frequency and the value of Internet Temporary cache (picture 2)
    - change the duration of history saves (picture 3)

    Screenshots (french) :
    Picture 1 :
    How to set Internet options without UI ?-capture1.png
    Picture 2 :
    How to set Internet options without UI ?-capture2.png
    Picture 3 :
    How to set Internet options without UI ?-capture3.png

    Thank you very much ! :)

    Govi
      My Computer


  2. Posts : 42,992
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hello, I doubt anyone is going to write you a script, but I will give you just one possible hint if you want to explore this further yourself.

    Basic question- how do you find out what changes in the registry? (if that's where these changes are made).

    Get yourself a copy of a program called Regshot (free) - it lets you create a snapshot before and after and compare them. Thus you may be able to work out what changes. However, if the content of the key is extensive or obscure, even with this it can be very hard to do that.

    Another angle: Whilst Autohotkey (free scripting tool) allows manipulation of Windows dialogues such as you describe, success with that also depends on being able to adequately identify the elements of the dialogue with which you wish to interact.
      My Computers


  3. Posts : 16
    64 bits Windows 10 home
    Thread Starter
       #3

    Hello Dalchina,
    thank you for your answer. Indeed, I managed to do some stuff with RegShot, which is a very nice tool. Thank you !
    Here is what I acheived, maybe it can help people :

    Check the "Clear browsing history on exit" box :

    --> set 1 to HKCU\SOFTWARE\Microsoft\Internet Explorer\ClearBrowsingHistoryOnExit
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "ClearBrowsingHistoryOnExit" /t REG_DWORD /d 0x00000001 /f

    Temporary Internet files (cache) : choose which frequency to check latest version

    --> This is controlled by the key : HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\SyncMode5
    Actually, setting the key in the registry doesn't change the checkbox, but I guess it changes anyway.
    - Each visit of the web page :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d 0x00000003 /f
    - Each launch of IE :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d 0x00000002 /f
    - Automatic :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d 0x00000004 /f
    - Never :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v "SyncMode5" /t REG_DWORD /d 0x00000000 /f
    Maybe the value 1 stands for something..? Mystery.


    Space to use on the disk for cache :

    When I change the value, these 2 keys change :
    - HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\ContentLimit
    - HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content\CacheLimit
    The first is exactly the number we choose in the UI (in hexadecimal notation)
    I don't know what the second key does, but it changes and the value is coherent (when I change twice, the value is the same).
    Here is the code when we set to 8 Mo :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache" /v "ContentLimit" /t REG_DWORD /d 0x00000008 /freg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content" /v "CacheLimit" /t REG_DWORD /d 0x00002000 /f
    Again, setting these keys in the registry database doesn't change the value displayed in the UI, but I guess it changes anyway.


    History : days to keep the visited webpages

    Here it is very simple, and setting the key changes the displayed value.
    The key : HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Url History\DaysToKeep
    To set 0 :
    Code:
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Url History" /v DaysToKeep /t REG_DWORD /d 0x00000000 /f

    Start page :
    This is the point I didn't suceed. I guess this key does something :
    HKCU\SOFTWARE\Microsoft\Internet Explorer\Main\Start Page
    but changing it doesn't directly change the startpage : it displays a message at IE launch : "An unknown program tries to set your start page to https://www.google.fr/. [change] [don't change]"
    How to set Internet options without UI ?-capture.png
    Maybe there are other things to see in HKLM or in other keys (RegShot shows that several keys are affected, but it is difficult to make a logical link).


    Hope it can help !
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:54.
Find Us




Windows 10 Forums