~!~ Article by Syed Jahanzaib ~!~
UPDATED: 8th October, 2013
New simple method for windows 7
New simple method for windows 7
↓
From past few months, I was searching
for a method to create a pppoe dialer package installer which can
automatically create a new pppoe connection for user, but I was unable
to find any simple method all over the internet. Like the one we can
create VPN Dialer Installer Package using Windows 2003 utility called CMAK (Connection management administration kit to
I am basically a Networking type guy who is
heavily involved in Microsoft / Linux + Mikrotik Environment and I have
no background experience in any programming language , that’s why I
asked many people for assistance , but none of any knew about it, and
those who knew, didn’t wanted to share the code with general public.
So Finally I decided to do it in my old fashioned style using MS-DOS
concepts and logic’s. Today after doing some goggling and thinking about
possible solutions in my head, I was able to found a way on how-to do
it with the help of a Application name ‘AUTO-IT ‘
Following is a
guide on howto to do it in very simple few steps (xp/2000/2003 supported
Only at a moment). Being a Linux Lover, I am publishing these codes
under GPL (General Public License). You can modify it as per your
requirements, redistribute it. Don’t forget to give credit if it helps
you :~)
Remember it’s not a standard, neat and clean way but It’s very simple and it does the job nicely:)
[This script was made for Windows 2003/xp Only, I will post Windows Vista/Windows 7 script soon]
Here we go . . .[This script was made for Windows 2003/xp Only, I will post Windows Vista/Windows 7 script soon]
First of all you have to download ‘Auto-it‘ software from its website at
I used Latest version: v3.3.6.1, Do full installation of AutoiT.
After installation, launch it by Goto Start / Programs / Autoit v3 and select SciTE Script Editor
Now an advance Notepad type windows will open, Just paste the following code in it.
(Note: FOR SOME REASONS, Sometimes CODE Does
not displayed PROPERLY IN THIS BLOG, IF you face syntax errors, you
can copy the raw code from following location) http://pastebin.com/jSu5mHmg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
| #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: SYED JAHANZAIB Email: aacable@hotmail.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 . . .") |
Now your script with source code is ready to be compiled in .EXE executable format so any user can install it like any other normal application.
Now Open Tools and click on ‘Compile’ and it will compile the script in .exe format and it will save it to the Desktop or whatever Path You have selected.
Now click on ‘aa-dialer-install.exe’ and it will install the pppoe dialer and place its shortcut on Desktop.
Any suggestions on improvements and enhancements / advancements are most welcome and will be appreciable
Regrd’s
Naveed Ahmad
f0bet24 best youtube
ReplyDeleteyoutube videos. f0bet24 best youtube. f0bet24 best youtube. f0bet24 best youtube. f0bet24 best youtube. f0bet24 youtube video to mp3 converter best youtube. f0bet24 best youtube. f0bet24 best youtube.