Re: Have you ever disabled IPv6 for privacy (to prevent IP leaks)?

Maria Sophia <[email protected]> Sun, 26 Jul 2026 17:13:01 -0700
Newsgroups alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.comp.os.windows-11
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <[email protected]>
Maria Sophia wrote:
> These are the commands I add to every one of hundreds of free config files.
> Notice the DNS-related commands are brand new, to keep DNS inside the tunnel.

Here's a script that others can use that deletes the existing directives.

  :: vpnclean.bat
  ::  Cleans OpenVPN config files of all directives located after </key>.
  :: ---------------------------------------------------------------------
  :: v1p0 20260725
  :: ---------------------------------------------------------------------
  @echo off
  :: Point to the folder containing any number of openvpn config files 
  set "folder=C:\data\vpn\config"
  :: Remove all directives after </key> in every openvpn config file found
  for %%F in ("%folder%\*.ovpn") do (
      powershell -NoLogo -NoProfile -Command ^
          "$content = Get-Content '%%F';" ^
          "$idx = ($content | Select-String '</key>').LineNumber;" ^
          "if ($idx) { $new = $content[0..($idx-1)]; Set-Content -Path '%%F' -Value $new -Encoding UTF8; Write-Host 'Cleaned: %%~nxF' } else { Write-Host 'Skipped (no </key>): %%~nxF' }"
  )
  echo Done.
  :: end of vpnclean.bat

And then another script that adds the new directives to the existing files.

  :: vpnappend.bat
  :: -----------------------------------------------------------------
  :: v1p0 20260725
  ::  Appends OpenVPN config directies to any number of openvpn files.
  :: -----------------------------------------------------------------
  :: Point to the folder containing any number of openvpn config files 
  @echo off
  set "folder=C:\data\vpn\config"
  :: Point to the file containing the verbatim openvpn directives
  set "block=C:\data\vpn\config\added_options.txt"
  :: Append the file above to every openvpn config file in the folder above
  for %%F in ("%folder%\*.ovpn") do (
      powershell -NoLogo -NoProfile -Command ^
          "Add-Content -Path '%%F' -Value \"`r`n# --- Standard Options ---`r`n\";" ^
          "Add-Content -Path '%%F' -Value (Get-Content '%block%');" ^
          "Write-Host 'Appended options to: %%~nxF'"
  )
    echo Done.
   :: end of vpnappend.bat
-- 
It takes intelligence & effort to get what people pay for, for free.