• Testado nas seguintes versões do Windows® •:
XP Pro 32 bits, 7 Pro 64 bits, 8.0 Pro 64 bits & 10 Pro 64 bits
:: I believe you can make use of the sendKey (in VBS), to make some keystrokes shortcut, as Tabs, Arrows, Etc... needed to arrive at the button OK
and then send the ENTER
, that will function as a Click!!
@echo off & setlocal enabledelayedexpansion
>"%temp%\_temp_file_4vbs_.vbs"^
(
echo/ Set WshShell = WScript.CreateObject^("WScript.Shell"^)
echo/ Set objShell = WScript.CreateObject^("WScript.Shell"^)
echo/ Wscript.Sleep 1500
echo/ objShell.AppActivate "inetcpl.cpl"
echo/ Wscript.Sleep 100
echo/ WshShell.SendKeys "({UP})"
echo/ Wscript.Sleep 1500
echo/ WshShell.SendKeys "(+{TAB})"
echo/ Wscript.Sleep 1500
echo/ WshShell.SendKeys "(+{UP})"
echo/ Wscript.Sleep 1500
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1500
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 2000
echo/ WshShell.SendKeys "({ENTER})"
) & set "_temp_vbs=%temp%\_temp_file_4vbs_.vbs"
start "" /w "%Windir%\System32\inetcpl.cpl"
start "" /w "%Windir%\System32\wScript.exe" //nologo "!_temp_vbs!"
del /q /f "!_temp_vbs!" & goto :eof
Obs.: To open the tab directly "connections" via cmd/bat, use the command below:
start "" /w rundll32.exe Shell32.dll,Control_RunDLL Inetcpl.cpl,,4
Update: Setando home page e VPN
@echo off & setlocal enabledelayedexpansion
>"%temp%\_temp_file_4vbs_.vbs"^
(
echo/ Set WshShell = WScript.CreateObject^("WScript.Shell"^)
echo/ Set objShell = WScript.CreateObject^("WScript.Shell"^)
echo/ StrHomePage = "http://www.google.com/ncr"
echo/ StringProxy = "http://proxy.stackoverflow.com.br:3128"
echo/ Wscript.Sleep 100
echo/ objShell.AppActivate "inetcpl.cpl"
echo/ for h=1 To Len^(StrHomePage^)
echo/ x = Mid^(StrHomePage,h,1^)
echo/ WshShell.SendKeys x
echo/ Wscript.Sleep 150
echo/ Next
echo/ Wscript.Sleep 1000
echo/ WshShell.SendKeys "({UP})"
echo/ Wscript.Sleep 100
echo/ WshShell.SendKeys "(+{TAB})"
echo/ Wscript.Sleep 100
echo/ WshShell.SendKeys "(+{UP})"
echo/ for i=1 to 3
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1000
echo/ Next
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1000
echo/ WshShell.SendKeys "({ENTER})"
echo/ Wscript.Sleep 1000
echo/ WshShell.SendKeys "({BACKSPACE})"
echo/ for j=1 To Len^(StringProxy^)
echo/ x = Mid^(StringProxy,j,1^)
echo/ WshShell.SendKeys x
echo/ Wscript.Sleep 150
echo/ Next
echo/ WshShell.SendKeys "({TAB})"
echo/ WshShell.SendKeys "({END})"
echo/ WshShell.SendKeys " "
echo/ WshShell.SendKeys "2"
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1000
echo/ for k=1 to 3
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1000
echo/ Next
echo/ WshShell.SendKeys "({ENTER})"
echo/ for l=1 to 5
echo/ WshShell.SendKeys "({TAB})"
echo/ Wscript.Sleep 1000
echo/ Next
echo/ WshShell.SendKeys "({ENTER})"
echo/
) & set "_temp_vbs=%temp%\_temp_file_4vbs_.vbs"
start "" /w "%Windir%\System32\inetcpl.cpl"
start "" /w "%Windir%\System32\wScript.exe" //nologo "!_temp_vbs!"
del /q /f "!_temp_vbs!" && goto :eof
Nothing! I just needed time to test.
– John Schmitz
I didn’t even notice that I had given the down, but it wasn’t even in your answer was it? It had been in my own question.
– John Schmitz
Thank you very much, it’s very good your question..
– It Wasn't Me
You have to use several ways, just need to test the keys first, see how it interacts c the "interface", then use them in the code to configure what is necessary..
– It Wasn't Me