
8th Oct , 2013 9:30pm : Entry added to create network profile folder if not already there (usually on fresh win7)
9th Oct , 2013 01:45pm : Entry added to create new phonbook profile, it will not overwrite or delete previous one :)
♥
Following is a simple and quickest method to create pppoe dialer using MSDOS batch file made for Windows 7, which create a new rasphone profile for PPPoE Dialer. Usually this sort of work is done using VB , or VB/VC# .NET with Dotras type programming languages which does the job nicely with lots of options and fancy look menus etc, but due to my limited knowledge towards programming, I decided to go with my traditional CLI method. I created this batch program in a very short time without much googling.
↓
Phonebook Location to store profiles (new and old)
1
| %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\ |
Any suggestion to improve the method will be highly appreciable . . . Please psot your comment if this batch file is working ok for you . . .
Let’s Start.
Create a new batch file like
notepad c:\dialer.bat
Paste following data and save.
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
| @echo offremrem #########################################rem ### PPPoE Dialer Script for Windows 7rem ### Syed Jahanzaib / aacable@hotmail.comrem ### http://aacablw.wordpress.comrem #########################################rem ### Creating pppoe profile in a temporarily text fileecho. 2> c:\rstemp.txtecho [AA_PPPoE_Dialer] >> c:\rstemp.txtecho Encoding=1 >> c:\rstemp.txtecho PBVersion=1 >> c:\rstemp.txtecho Type=5 >> c:\rstemp.txtecho AutoLogon=0 >> c:\rstemp.txtecho UseRasCredentials=0 >> c:\rstemp.txtecho LowDateTime=-582619296 >> c:\rstemp.txtecho HighDateTime=30327625 >> c:\rstemp.txtecho DialParamsUID=6326979 >> c:\rstemp.txtecho Guid=359A05BF4C146640949F56383A0F18F5 >> c:\rstemp.txtecho VpnStrategy=0 >> c:\rstemp.txtecho ExcludedProtocols=0 >> c:\rstemp.txtecho LcpExtensions=1 >> c:\rstemp.txtecho DataEncryption=8 >> c:\rstemp.txtecho SwCompression=0 >> c:\rstemp.txtecho NegotiateMultilinkAlways=0 >> c:\rstemp.txtecho SkipDoubleDialDialog=0 >> c:\rstemp.txtecho DialMode=0 >> c:\rstemp.txtecho OverridePref=15 >> c:\rstemp.txtecho RedialAttempts=3 >> c:\rstemp.txtecho RedialSeconds=60 >> c:\rstemp.txtecho IdleDisconnectSeconds=0 >> c:\rstemp.txtecho RedialOnLinkFailure=1 >> c:\rstemp.txtecho CallbackMode=0 >> c:\rstemp.txtecho CustomDialDll= >> c:\rstemp.txtecho CustomDialFunc= >> c:\rstemp.txtecho CustomRasDialDll= >> c:\rstemp.txtecho ForceSecureCompartment=0 >> c:\rstemp.txtecho DisableIKENameEkuCheck=0 >> c:\rstemp.txtecho AuthenticateServer=0 >> c:\rstemp.txtecho ShareMsFilePrint=0 >> c:\rstemp.txtecho BindMsNetClient=0 >> c:\rstemp.txtecho SharedPhoneNumbers=0 >> c:\rstemp.txtecho GlobalDeviceSettings=0 >> c:\rstemp.txtecho PrerequisiteEntry= >> c:\rstemp.txtecho PrerequisitePbk= >> c:\rstemp.txtecho PreferredPort=PPPoE4-0 >> c:\rstemp.txtecho PreferredDevice=WAN Miniport (PPPOE) >> c:\rstemp.txtecho PreferredBps=0 >> c:\rstemp.txtecho PreferredHwFlow=0 >> c:\rstemp.txtecho PreferredProtocol=0 >> c:\rstemp.txtecho PreferredCompression=0 >> c:\rstemp.txtecho PreferredSpeaker=0 >> c:\rstemp.txtecho PreferredMdmProtocol=0 >> c:\rstemp.txtecho PreviewUserPw=1 >> c:\rstemp.txtecho PreviewDomain=0 >> c:\rstemp.txtecho PreviewPhoneNumber=0 >> c:\rstemp.txtecho ShowDialingProgress=1 >> c:\rstemp.txtecho ShowMonitorIconInTaskBar=1 >> c:\rstemp.txtecho CustomAuthKey=0 >> c:\rstemp.txtecho AuthRestrictions=552 >> c:\rstemp.txtecho IpPrioritizeRemote=1 >> c:\rstemp.txtecho IpInterfaceMetric=0 >> c:\rstemp.txtecho IpHeaderCompression=0 >> c:\rstemp.txtecho IpAddress=0.0.0.0 >> c:\rstemp.txtecho IpDnsAddress=0.0.0.0 >> c:\rstemp.txtecho IpDns2Address=0.0.0.0 >> c:\rstemp.txtecho IpWinsAddress=0.0.0.0 >> c:\rstemp.txtecho IpWins2Address=0.0.0.0 >> c:\rstemp.txtecho IpAssign=1 >> c:\rstemp.txtecho IpNameAssign=1 >> c:\rstemp.txtecho IpDnsFlags=0 >> c:\rstemp.txtecho IpNBTFlags=0 >> c:\rstemp.txtecho TcpWindowSize=0 >> c:\rstemp.txtecho UseFlags=3 >> c:\rstemp.txtecho IpSecFlags=0 >> c:\rstemp.txtecho IpDnsSuffix= >> c:\rstemp.txtecho Ipv6Assign=1 >> c:\rstemp.txtecho Ipv6Address=:: >> c:\rstemp.txtecho Ipv6PrefixLength=0 >> c:\rstemp.txtecho Ipv6PrioritizeRemote=1 >> c:\rstemp.txtecho Ipv6InterfaceMetric=0 >> c:\rstemp.txtecho Ipv6NameAssign=1 >> c:\rstemp.txtecho Ipv6DnsAddress=:: >> c:\rstemp.txtecho Ipv6Dns2Address=:: >> c:\rstemp.txtecho Ipv6Prefix=0000000000000000 >> c:\rstemp.txtecho Ipv6InterfaceId=0000000000000000 >> c:\rstemp.txtecho DisableClassBasedDefaultRoute=0 >> c:\rstemp.txtecho DisableMobility=0 >> c:\rstemp.txtecho NetworkOutageTime=0 >> c:\rstemp.txtecho ProvisionType=0 >> c:\rstemp.txtecho PreSharedKey= >> c:\rstemp.txtecho NETCOMPONENTS= >> c:\rstemp.txtecho ms_msclient=0 >> c:\rstemp.txtecho ms_server=0 >> c:\rstemp.txtecho MEDIA=rastapi >> c:\rstemp.txtecho Port=PPPoE4-0 >> c:\rstemp.txtecho Device=WAN Miniport (PPPOE) >> c:\rstemp.txtecho DEVICE=PPPoE >> c:\rstemp.txtecho LastSelectedPhone=0 >> c:\rstemp.txtecho PromoteAlternates=0 >> c:\rstemp.txtecho TryNextAlternateOnFail=1 >> c:\rstemp.txtrem ### Removing white spaces so that it can be readable by phone book /zaibrem echo. 2> c:\rscompile.batrem if [%1]==[] then echo File name missing & goto :EOF >>(for /f "tokens=1" %%a in (rstemp.txt) do echo %%a) > %~n1aa-rasphone.pbkrem ### Location for rasphone.pbk [just for reference] /zaibrem %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\rem ### Creating Network Profile Folder to store dialer profile, if its not there alreadymkdir %userprofile%\AppData\Roaming\Microsoft\Networkmkdir %userprofile%\AppData\Roaming\Microsoft\Network\Connectionsmkdir %userprofile%\AppData\Roaming\Microsoft\Network\Connections\pbkclsrem Copy new rasphone.pbk to user network profile /zaibrem cd %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\rem ren rasphone.pbk rasphone.pbk.oldcopy c:\aa-rasphone.pbk %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\rem ### Create Network Connection Center Icon on Desktop /zaibrem ### I coulnd't found a way to create shortcut of dialer on desktop, someone please suggestset linkName=AA-Network Connectionsset linkPath=%userprofile%\desktopset program=C:\WINDOWS\SYSTEM32\ncpa.cplset workDir=C:\WINDOWS\system32set iconfile=%SystemRoot%\system32\SHELL32.dllset icon=-18set windowStyle=2echo Set oWS = WScript.CreateObject("WScript.Shell") > temp.vbsecho sLinkFile = "%linkPath%\%linkName%.LNK" >> temp.vbsecho Set oLink = oWS.CreateShortcut(sLinkFile) >> temp.vbsecho oLink.TargetPath = "%program%" >> temp.vbsecho oLink.IconLocation = "%iconFile%, %icon%" >> temp.vbsecho oLink.WindowStyle = "%windowStyle%" >> temp.vbsecho oLink.WorkingDirectory = "%workdir%" >> temp.vbsecho oLink.Save >> temp.vbsWScript.exe temp.vbsdel temp.vbsrem #rem ### Show Popup Message box after everything completed /zaibrem #mshta javascript:alert("Dialer Installation Completed!!!\n\Please Restart you computern ,Thank You\n\Syed.Jahanzaib! aacable@hotmail.com");close();rem # THE END # |
Now execute it from c:\dialer.bat & then restart your computer. If you dont want to restart the newly created connection will not show in network connections, You have to press F5 in the network connections to display the newly created profile. After restart it will appear auto in network and sharing center.
↓
After successful lab testing, its time to make it a distributable package. To convert it in executable package, you download BATCH to EXE converter.
extract and run Bat_To_Exe_Converter.exe
Fill up the required info as shown in teh images below and click on compile.
↓

and click on COMPILE , it will create .exe Package. You can also add additional info like ICON file , or product version or info
As showed in the image below . .

.
.
End results :)

↓






0 comments:
Post a Comment