Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Vbs Help


  • Please log in to reply
1 reply to this topic

#1 Bruno1975

Bruno1975

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:03:33 AM

Posted 27 March 2007 - 08:24 AM

Hi I am looking for some assistance with VBS.

I have exported 2 registry keys one that turns on a proxy in internet explorer and the other one that turns it off. I want to create a menu option that gives a user the choice of it on or off without haveing to see both files just a exe or vbs that they click and it will ask them if they want to use proxy or not and this will choose the right file to run.

Does anyone know how I can do this.

Thank You

BC AdBot (Login to Remove)

 


m

#2 Bruno1975

Bruno1975
  • Topic Starter

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:03:33 AM

Posted 27 March 2007 - 08:58 AM

I got this in vbs and this does not use my registry keys

Const REG_ENTRY = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"

Set Shell = CreateObject("WScript.Shell")
Path = REG_ENTRY

'On Error resume next
CurrentValue = Shell.RegRead(Path & "ProxyEnable")

If CurrentValue="" Then
Response = MsgBox ("Your Proxy is set to : Direct Internet " & _
vbCrLf & _
"Would you like to change it to VPN?", vbYesNo, "CDS VPN Script for IE")
If Response = vbYes Then
Shell.RegWrite Path & "AutoConfigURL", ""
Shell.RegWrite Path & "ProxyEnable","1"
Shell.RegWrite Path & "ProxyServer", "titan2.studio.cdsorg.net:80"
End If

Else
Response = MsgBox ("Your Proxy is set to : " & _
CurrentValue & vbCrLf & _
"Would you like to change it to DIRECT INTERNET?", vbYesNo, "CDS VPN Script for IE")
If Response = vbYes Then
Shell.RegWrite Path & "AutoConfigURL", ""
Shell.RegWrite Path & "ProxyEnable","0"
Shell.RegWrite Path & "ProxyServer","titan2.studio.cdsorg.net:80"
End If

End if


When the proxy is off the vbs turns it on my problem now is when it is on the vbs does not turn it off.

Anyone have any ideas.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users