[ mica99 @ 16.09.2012. 09:35 ] @
Da li postoji mogucnost da se napravi soft koji ce automatski napraviti PPPoE konekciju na windows XP, Vista, 7? Ja sam skidao neke scripte radjene u autoit , radi na XP a scripta za win7 ne radi na svaki racunar. Naravno program bi hteo da ga pravim u delphi ali nemam predstavu da li je uopste moguce. Dole su navedene scripte u autoit: #cs ---------------------------------------------------------------------------- AutoIt Version : 3.3.6.1 Author : SYED JAHANZAIB Email : [email protected] Web : http://aacable.wordpress.com Script Function: Template AutoIt script. for PPPoE Dialer Installer OS Supported : Windows 7 Dated : 27/09/2011 #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $DELAY = 300 $answer = MsgBox(4, "PPPOE Connection", "This script will create a PPPOE DIALER, Do you want to Continue?") If $answer = 7 Then Exit EndIf WinMinimizeAll ( ) ; Put Logo in front and do installation in background, place dialer.jpg in the same folder ; From you have launched dialer. SplashImageOn("Please wait Few Seconds While Installer Installs PPPoE Dialer ", "dialer.jpg", 800,650) $COMPANY_NAME = ("Type Your pppoe service name here") ; Example $COMPANY_NAME = ("MY_ISP") $DELAY = 300 ; Run Windows 7 Network Setup Run("control.exe /name Microsoft.NetworkAndSharingCenter") Sleep($DELAY) ; Send TAB 7 times to Select 'setup a new connection' Send("{TAB 7}") ; Send Enter to Launch 'setup a new connection' Send("{ENTER}") ; Send Next to select 'Connect to Internet' Sleep($DELAY) Send("!n") ; Send 'S' to select 'Setup a new connection anyway Sleep($DELAY) Send("!s") ;Check Duplicate Connection ??? Sleep($DELAY) Send("!n") ; Send 'r' to select 'Broadband PPPoE' Sleep($DELAY) Send("!r") ; Send TAB 4 times to Enter 'ISP NAME' Sleep($DELAY) Send("{TAB 4}") Send($COMPANY_NAME) Sleep($DELAY) ; Send 'c' to connect $COMPANY_NAME service to contiue further Sleep($DELAY) Send("!c") ; Send 's' to skip connect '$comapany name' service to contiue further Sleep($DELAY) Send("!s") ; Send 'c' to close. Sleep($DELAY) Send("!c") WinClose("Network Connections") Run("control.exe /name Microsoft.NetworkAndSharingCenter") Sleep($DELAY) Send("!F") Send("c") SplashOff ( ) Sleep($DELAY) Run("control ncpa.cpl") WinWaitActive("Network Connections") Sleep($DELAY) ;send ( "!{TAB}" ) Sleep($DELAY) MsgBox(0, "Setup Complete", "Your Dialer have been installed , Click Connect on " & $COMPANY_NAME & " to initiate Dialing") ----------------------------------------------------------------------------------------------------------------------- #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: SYED JAHANZAIB Email: [email protected] Web: http://aacable.wordpress.com OS Supported: Windows XP Script Function: Template AutoIt script. for PPPoE Dialer Installer #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #NoTrayIcon #compiler_icon=itlifesaver.ico #include <GUIConstants.au3> $COMPANY_NAME = "AACABLE - DIALER SERVICE" ; name of the pppoe icon, friendly description $SERVICE_NAME = "aa" ; name of the pppoe service configured in NAS/Mikrotik $DELAY = 200 ; change this DELAY value to speedup or slow down the process, ;any range between 200-300 is better in my view, too fast will shatter things ;This is for showing your logo for 2 secs ;$destination = "C:\Program Files\AutoIt3\Examples\GUI\mslogo.jpg" ;SplashImageOn("Splash Screen", $destination,250,50) ;Sleep(2000) ;SplashOff() $answer = MsgBox(4, "PPPOE Connection", "This script will create a PPPOE DIALER connection to " & $COMPANY_NAME & ", Ready?") If $answer = 7 Then Exit EndIf ; Prompt user for PPPOE login info $frmInformation = GUICreate("Enter Information", 287, 194, 193, 115) $lblUserName = GUICtrlCreateLabel("User Name:", 16, 40, 60, 17) $lblPassword = GUICtrlCreateLabel("Password:", 16, 80, 53, 17) $txtUserName = GUICtrlCreateInput("", 112, 40, 153, 21) Dim $ES_PASSWORD,$ES_AUTOHSCROLL $txtPassword = GUICtrlCreateInput("", 112, 80, 153, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $lblPassword2 = GUICtrlCreateLabel("Confirm Password:", 16, 120, 91, 17) $txtPassword2 = GUICtrlCreateInput("", 112, 120, 153, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $btnOK = GUICtrlCreateButton("&OK", 200, 160, 75, 25, 0) $lblInfo = GUICtrlCreateLabel("Enter your pppoe Login Information Below!", 48, 8, 196, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $btnOK If GUICtrlRead($txtPassword) <> GUICtrlRead($txtPassword2) Then MsgBox (16, "Error", "Passwords do not match! Try again.") Else $Username = GUICtrlRead($txtUsername) $Password = GUICtrlRead($txtPassword) ExitLoop EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUISetState(@SW_HIDE) ; Run Network Setup Run("control ncpa.cpl") WinWaitActive("Network Connections") ; Check if PPPOE dialer by same name already exists, since it'll break script later if Windows add's a number at the end of the name... $ControlID = ControlListView("Network Connections", "", "SysListView321", "FindItem", $COMPANY_NAME, "AACABLE - DIALER SERVICE") If $ControlID <> -1 Then $answer = MsgBox(4404, "Error", "Connection to " & $COMPANY_NAME & " already exists! Remove it and recreate it?") If $answer = 6 Then ControlListView("Network Connections", "", "SysListView321", "Select", $ControlID) Send("{DEL}") WinWaitActive("Confirm Connection Delete") Send("!y") Sleep($DELAY) Else MsgBox(16, "Exit", "Script stopped by user") Exit EndIf EndIf ; open new connection wizard from file menu Send("!f") Send("n") Sleep($DELAY) ; New Connection Wizard Sleep($DELAY) Send("!n") Sleep($DELAY) ; Choose Conncetion type Sleep($DELAY) Send("!n") Sleep($DELAY) ; setup connectoin manuall Send("!m") Sleep($DELAY) Send("!n") Sleep($DELAY) ; Connect using broadband connection with user name n passwd Send("!u") Sleep($DELAY) Send("!n") Sleep($DELAY) ; Send Your ISP Name Send($COMPANY_NAME) Send("!n") Sleep($DELAY) ;Donot send id password here, we will set it in End Send("!n") Sleep($DELAY) ; Wizard Complete, do we want a desktop shortcut? Send("!s") Sleep($DELAY) Send("{ENTER}") WinWaitClose("New Connection Wizard") WinWaitActive("Connect " & $COMPANY_NAME) Send($Username) Send("{TAB}") Send($Password) Sleep($DELAY) Send("!s") ; save password... Send("!a") ; for anyone who uses this computer, use "!n" for 'Me only' Sleep($DELAY) WinClose("Network Connections") MsgBox(0, "Setup Complete", "Your Dialer have been installed , Click Connect to initiate dialing . . .") |