Windows 10: Need help with batch file

Discus and support Need help with batch file in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by mike6623, Jan 18, 2017.

  1. mike6623 Win User

    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.

    :)
     
    mike6623, Jan 18, 2017
    #1

  2. microsoft should make a store app for just batch files or vbs scripts and software

    so I was thinking people could make help full batch files that will help people so they do not have to do a lot of typing to fix their pc .

    We all know that batch files are very powerful scripts. SO if you can use the batch files and vbs to help others all the batch files should be free. This could help millions of people or get people to start making batch files to . I want this to happen .and
    apply the new store app so it comes through an update not get it from the store.
     
    PeterTjapkes, Jan 18, 2017
    #2
  3. How to set an Ethernet Connection as Metered to control Updates, Drivers, Store and others

    so you cant run the batch file without taking ownership of that reg key, but this program changes your Ethernet to metered with a simple click.. unbelievable.

    Downloads / Software / Winaero Tweaker

    this still doesn't help me. I need to automate this and make it metered for all desktops on my network.

    any idea why the batch wouldn't work. The commands in the batch file are supposed to change ownership. Did i miss something?
     
    Kenneth Santiago, Jan 18, 2017
    #3
  4. Samuria Win User

    Need help with batch file

    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
     
    Samuria, Jan 18, 2017
    #4
  5. mike6623 Win User
    Thanks, much appreciated, but I am more into learning how to complete these task instead of a program doing it for me.
     
    mike6623, Jan 18, 2017
    #5
  6. Samuria Win User
    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
     
    Samuria, Jan 18, 2017
    #6
  7. Pyprohly Win User
    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[/quote] 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 ) )[/quote]
     
    Pyprohly, Jan 18, 2017
    #7
  8. mike6623 Win User

    Need help with batch file

    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 ) )[/quote] [/quote] 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
     
    mike6623, Jan 18, 2017
    #8
  9. Pyprohly Win User
    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?
     
    Pyprohly, Apr 4, 2018
    #9
Thema:

Need help with batch file

Loading...
  1. Need help with batch file - Similar Threads - Need help batch

  2. Batch Files

    in Windows 10 Network and Sharing
    Batch Files: I cannot remember how to open a FILE browser in batch, i was trying to create something were it opens a file browser, and the file you click on, gets deleted. https://answers.microsoft.com/en-us/windows/forum/all/batch-files/335a0e0d-62b0-4615-b303-4a7bb548cc6c"
  3. Batch File help!

    in Windows 10 Ask Insider
    Batch File help!: I'm trying to run a batch file that scans the network for a set IP range. When I run the commands individually through command prompt they work just fine. I've saved the txt file as both a .cmd, and .bat. I've also ran both as administrator, as well as navigating to the...
  4. Need batch file help

    in Windows 10 Support
    Need batch file help: I want to create a script to start a game at E:\Grand Theft Auto V\PlayGTAV.exe and wait one minute and then open an existing batch file at E:\Grand Theft Auto V\GTAV Hardcore.bat What do I have to add to the following? start /b "" "E:\Grand Theft Auto V\PlayGTAV.exe" start...
  5. batch file

    in Windows 10 Network and Sharing
    batch file: I want a BAT file to be executed when a USB plugged in to the PC. How can I do it? https://answers.microsoft.com/en-us/windows/forum/all/batch-file/1af5ec02-b6c8-4916-959b-ed0327a964e7"
  6. Need some help making a short batch file

    in Windows 10 Software and Apps
    Need some help making a short batch file: Hi I need help with a rather short batchfile. I need Two actually each with subtle differences.. Batch file A 1-Check the date of the file on a USB pen in folder B is newer than the same file on the PC if it is then replace the file 2-run a .exe program ( I hope the batch...
  7. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...
  8. Batch File Help

    in Windows 10 Software and Apps
    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 automatically. If you stop and start...
  9. Need to create batch file for "net share" command

    in Windows 10 Network and Sharing
    Need to create batch file for "net share" command: I created a simple command from powershell that maps a drive for me using the "net share" command (see below). However, i want to turn this in to a batch file so I do not have to type it every time. When I name it filename.bat and try to run it, I get a system error 5 has...
  10. Need Help Creating Batch file to speed up Windows 10

    in Windows 10 Performance & Maintenance
    Need Help Creating Batch file to speed up Windows 10: I've been working to get some speed back on my laptop but I haven't been able to understand where or how I can get the text that needs to be pasted in the .bat file. I've looked and looked and can't find a clear answer anywhere. 31022