Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.