Skip to content

Instantly share code, notes, and snippets.

@jkbryan
Created October 2, 2018 20:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jkbryan/39130ca5df97b5c9ea380ac8d58315a7 to your computer and use it in GitHub Desktop.
get-vpn-proxy-values.vbs
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Const ForAppending = 8
strComputer = "."
'Setup text file to write results to
Set fso = CreateObject("Scripting.FileSystemObject")
Set objTextFile = fso.OpenTextFile("C:\temp\proxy.txt",ForAppending, True)
dim iValues(1)
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
'
ValueName = "DefaultConnectionSettings"
objReg.GetBinaryValue HKEY_CURRENT_USER, strKeyPath, ValueName, iValues
objTextFile.WriteLine ValueName & ": " & VbCrLf
For i = lBound(iValues) to uBound(iValues)
objTextFile.Write iValues(i) & ","
Next
objTextFile.WriteLine VbCrLf & "********************************************************************"
'
ValueName = "RandomVPN2"
objReg.GetBinaryValue HKEY_CURRENT_USER, strKeyPath, ValueName, iValues
objTextFile.WriteLine ValueName & ": " & VbCrLf
For i = lBound(iValues) to uBound(iValues)
objTextFile.Write iValues(i) & ","
Next
objTextFile.WriteLine VbCrLf & "********************************************************************"
'
ValueName = "RandomVPN2"
objReg.GetBinaryValue HKEY_CURRENT_USER, strKeyPath, ValueName, iValues
objTextFile.WriteLine ValueName & ": " & VbCrLf
For i = lBound(iValues) to uBound(iValues)
objTextFile.Write iValues(i) & ","
Next
objTextFile.WriteLine VbCrLf & "********************************************************************"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment