1.    18 Jan 2017 #1
    Join Date : Jul 2015
    Posts : 51
    Windows 10 64bit

    Need help with batch file


    No serious Batch file or scripting experience, so bear with me. We use a site for our business that has to run on IE and has to have the cache cleared a certain way sometimes for it to function.

    We have to go IE options, uncheck delete history on exit - go to delete browsing hisotry and
    uncheck preserve favorites
    check the rest
    delete/apply

    Then we have to go in the IE settings and go to delete browsing hisotry and
    Check preserve favorites
    Uncheck Temp files
    Uncheck cookies

    Delete/apply

    Having end users attempt to follow these directions has been a nightmare and so has manually doing this, either in person or remotely to over 290 pc's.

    All are on Windows 7 pro

    What can I create 2 shortcuts that, when double clicked, will execute those commands?
    I will push the shortcuts via gpo so that part I am good with

    Any help or advice would be great.
      My ComputerSystem Spec
  2.    18 Jan 2017 #2
    Join Date : Jul 2016
    Crewe Cheshire
    Posts : 1,466
    windows 10

    The best is to use a free program called autoit which is a programing language AutoIt its free and makes writing complex scripts simple you can then compile to an exe and run like any windows app. You will find you can create all sorts of apps very simply see tutor Tutorial - WinZip what makes it so good is can download a macro recorder so you record what you want it then produces the code for you as simple as that lots of video tutors for it Autoit Tutorials Part 2 Record and Play back using AU3Recorder - YouTube
      My ComputerSystem Spec
  3.    18 Jan 2017 #3
    Join Date : Jul 2015
    Posts : 51
    Windows 10 64bit
    Thread Starter

    Thanks, much appreciated, but I am more into learning how to complete these task instead of a program doing it for me.
      My ComputerSystem Spec
  4.    18 Jan 2017 #4
    Join Date : Jul 2016
    Crewe Cheshire
    Posts : 1,466
    windows 10

    You can use both write the code or use the macro using the macro ois a quick way to learn there are lots of forums and help for it its been about for years and very powerful offering a lot more than cmd files
      My ComputerSystem Spec
  5.    19 Jan 2017 #5
    Join Date : Mar 2015
    Sydney, NSW
    Posts : 93
    Windows 10

    Hi,

    Try this,
    Code:
    @echo off
    
    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess Flags:8389627
    
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "ClearBrowsingHistoryOnExit" /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "UseAllowList"            /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanTIF"                /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanCookies"            /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanHistory"            /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanDownloadHistory"    /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanForms"              /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanPassword"           /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanTrackingProtection" /t REG_DWORD /d 1 /f
    Or perhaps a little more complex:
    Code:
    @echo off
    
    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess Flags:8389627
    
    for %%I in (
    	ClearBrowsingHistoryOnExit:0
    	UseAllowList:1
    	CleanTIF:0
    	CleanCookies:0
    	CleanHistory:1 
    	CleanDownloadHistory:1
    	CleanForms:1
    	CleanPassword:1
    	CleanTrackingProtection:1
    ) do (
    	for /f "tokens=1,2 delims=:" %%I in ("%%~I") do (
    		reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "%%~I" /t REG_DWORD /d "%%~J" /f
    	)
    )
      My ComputerSystem Spec
  6.    19 Jan 2017 #6
    Join Date : Jul 2015
    Posts : 51
    Windows 10 64bit
    Thread Starter

    Quote Originally Posted by Pyprohly View Post
    Hi,

    Try this,
    Code:
    @echo off
    
    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess Flags:8389627
    
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "ClearBrowsingHistoryOnExit" /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "UseAllowList"            /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanTIF"                /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanCookies"            /t REG_DWORD /d 0 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanHistory"            /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanDownloadHistory"    /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanForms"              /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanPassword"           /t REG_DWORD /d 1 /f
    reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "CleanTrackingProtection" /t REG_DWORD /d 1 /f
    Or perhaps a little more complex:
    Code:
    @echo off
    
    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess Flags:8389627
    
    for %%I in (
        ClearBrowsingHistoryOnExit:0
        UseAllowList:1
        CleanTIF:0
        CleanCookies:0
        CleanHistory:1 
        CleanDownloadHistory:1
        CleanForms:1
        CleanPassword:1
        CleanTrackingProtection:1
    ) do (
        for /f "tokens=1,2 delims=:" %%I in ("%%~I") do (
            reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Privacy" /v "%%~I" /t REG_DWORD /d "%%~J" /f
        )
    )
    Thanks man! I will give that a shot and report back! Thanks a lot! Not being familiar with this, does this include the "unchecking" of preserve favorites, then rechecking it? I just am not sure how to read them in full and I know we are to keep the "delete browsing history on exit" UNCHECKED. This is just for when they experience a certain issue
      My ComputerSystem Spec
  7.    19 Jan 2017 #7
    Join Date : Mar 2015
    Sydney, NSW
    Posts : 93
    Windows 10

    Quote Originally Posted by mike6623 View Post
    [D]oes this include the "unchecking" of preserve favorites, then rechecking it?
    It just checks it. Because the checks are only a visual thing, only the final state matters. The registry edits handle the checking. If you need a different arrangement of checks, you can change what is to be checked or not by swapping zeros for ones or vice versa according to your needs. A ‘1’ means checked, ‘0’ unchecked.

    The actual clean up operation happens with the RunDll32 command which will clean up browsing history as if all options were checked except “Preserve Favorites website data”. What is actually cleaned up is not configureable. Did you need this to be?
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
autorun batch file usb
I want run a bat file from usb stick while inserting it plz help me
General Support
Batch File Help
I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user data backups. It has three services, and at times, one or two of the three don't start...
Software and Apps
How to change visual effects using batch file or registry file?
Hi there forum, how do you change the Visual effects using a batch file or registry file. Thanks, Edward.
General Support
Can't download batch file
Can't download batch file "10services_default.bat" to solve windows 10 start menu problem.
General Support
Solved Writhing Batch File
Here is my batch file but it will not delete the file? Must be missing something :( del "C:\Users\Larry\AppData\Local\TractorParts\tractor\ConfigSetting" Trying to delete the ConfigSetting File
General Support
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:10.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums