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 off rem rem ######################################### rem ### PPPoE Dialer Script for Windows 7 rem ### Syed Jahanzaib / aacable@hotmail.com rem ### http://aacablw.wordpress.com rem ######################################### rem ### Creating pppoe profile in a temporarily text file echo. 2> c:\rstemp.txt echo [AA_PPPoE_Dialer] >> c:\rstemp.txt echo Encoding=1 >> c:\rstemp.txt echo PBVersion=1 >> c:\rstemp.txt echo Type=5 >> c:\rstemp.txt echo AutoLogon=0 >> c:\rstemp.txt echo UseRasCredentials=0 >> c:\rstemp.txt echo LowDateTime=-582619296 >> c:\rstemp.txt echo HighDateTime=30327625 >> c:\rstemp.txt echo DialParamsUID=6326979 >> c:\rstemp.txt echo Guid=359A05BF4C146640949F56383A0F18F5 >> c:\rstemp.txt echo VpnStrategy=0 >> c:\rstemp.txt echo ExcludedProtocols=0 >> c:\rstemp.txt echo LcpExtensions=1 >> c:\rstemp.txt echo DataEncryption=8 >> c:\rstemp.txt echo SwCompression=0 >> c:\rstemp.txt echo NegotiateMultilinkAlways=0 >> c:\rstemp.txt echo SkipDoubleDialDialog=0 >> c:\rstemp.txt echo DialMode=0 >> c:\rstemp.txt echo OverridePref=15 >> c:\rstemp.txt echo RedialAttempts=3 >> c:\rstemp.txt echo RedialSeconds=60 >> c:\rstemp.txt echo IdleDisconnectSeconds=0 >> c:\rstemp.txt echo RedialOnLinkFailure=1 >> c:\rstemp.txt echo CallbackMode=0 >> c:\rstemp.txt echo CustomDialDll= >> c:\rstemp.txt echo CustomDialFunc= >> c:\rstemp.txt echo CustomRasDialDll= >> c:\rstemp.txt echo ForceSecureCompartment=0 >> c:\rstemp.txt echo DisableIKENameEkuCheck=0 >> c:\rstemp.txt echo AuthenticateServer=0 >> c:\rstemp.txt echo ShareMsFilePrint=0 >> c:\rstemp.txt echo BindMsNetClient=0 >> c:\rstemp.txt echo SharedPhoneNumbers=0 >> c:\rstemp.txt echo GlobalDeviceSettings=0 >> c:\rstemp.txt echo PrerequisiteEntry= >> c:\rstemp.txt echo PrerequisitePbk= >> c:\rstemp.txt echo PreferredPort=PPPoE4-0 >> c:\rstemp.txt echo PreferredDevice=WAN Miniport (PPPOE) >> c:\rstemp.txt echo PreferredBps=0 >> c:\rstemp.txt echo PreferredHwFlow=0 >> c:\rstemp.txt echo PreferredProtocol=0 >> c:\rstemp.txt echo PreferredCompression=0 >> c:\rstemp.txt echo PreferredSpeaker=0 >> c:\rstemp.txt echo PreferredMdmProtocol=0 >> c:\rstemp.txt echo PreviewUserPw=1 >> c:\rstemp.txt echo PreviewDomain=0 >> c:\rstemp.txt echo PreviewPhoneNumber=0 >> c:\rstemp.txt echo ShowDialingProgress=1 >> c:\rstemp.txt echo ShowMonitorIconInTaskBar=1 >> c:\rstemp.txt echo CustomAuthKey=0 >> c:\rstemp.txt echo AuthRestrictions=552 >> c:\rstemp.txt echo IpPrioritizeRemote=1 >> c:\rstemp.txt echo IpInterfaceMetric=0 >> c:\rstemp.txt echo IpHeaderCompression=0 >> c:\rstemp.txt echo IpAddress=0.0.0.0 >> c:\rstemp.txt echo IpDnsAddress=0.0.0.0 >> c:\rstemp.txt echo IpDns2Address=0.0.0.0 >> c:\rstemp.txt echo IpWinsAddress=0.0.0.0 >> c:\rstemp.txt echo IpWins2Address=0.0.0.0 >> c:\rstemp.txt echo IpAssign=1 >> c:\rstemp.txt echo IpNameAssign=1 >> c:\rstemp.txt echo IpDnsFlags=0 >> c:\rstemp.txt echo IpNBTFlags=0 >> c:\rstemp.txt echo TcpWindowSize=0 >> c:\rstemp.txt echo UseFlags=3 >> c:\rstemp.txt echo IpSecFlags=0 >> c:\rstemp.txt echo IpDnsSuffix= >> c:\rstemp.txt echo Ipv6Assign=1 >> c:\rstemp.txt echo Ipv6Address=:: >> c:\rstemp.txt echo Ipv6PrefixLength=0 >> c:\rstemp.txt echo Ipv6PrioritizeRemote=1 >> c:\rstemp.txt echo Ipv6InterfaceMetric=0 >> c:\rstemp.txt echo Ipv6NameAssign=1 >> c:\rstemp.txt echo Ipv6DnsAddress=:: >> c:\rstemp.txt echo Ipv6Dns2Address=:: >> c:\rstemp.txt echo Ipv6Prefix=0000000000000000 >> c:\rstemp.txt echo Ipv6InterfaceId=0000000000000000 >> c:\rstemp.txt echo DisableClassBasedDefaultRoute=0 >> c:\rstemp.txt echo DisableMobility=0 >> c:\rstemp.txt echo NetworkOutageTime=0 >> c:\rstemp.txt echo ProvisionType=0 >> c:\rstemp.txt echo PreSharedKey= >> c:\rstemp.txt echo NETCOMPONENTS= >> c:\rstemp.txt echo ms_msclient=0 >> c:\rstemp.txt echo ms_server=0 >> c:\rstemp.txt echo MEDIA=rastapi >> c:\rstemp.txt echo Port=PPPoE4-0 >> c:\rstemp.txt echo Device=WAN Miniport (PPPOE) >> c:\rstemp.txt echo DEVICE=PPPoE >> c:\rstemp.txt echo LastSelectedPhone=0 >> c:\rstemp.txt echo PromoteAlternates=0 >> c:\rstemp.txt echo TryNextAlternateOnFail=1 >> c:\rstemp.txt rem ### Removing white spaces so that it can be readable by phone book /zaib rem echo. 2> c:\rscompile.bat rem if [%1]==[] then echo File name missing & goto :EOF >> (for /f "tokens=1" %%a in (rstemp.txt) do echo %%a) > %~n1aa-rasphone.pbk rem ### Location for rasphone.pbk [just for reference] /zaib rem %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\ rem ### Creating Network Profile Folder to store dialer profile, if its not there already mkdir %userprofile%\AppData\Roaming\Microsoft\Network mkdir %userprofile%\AppData\Roaming\Microsoft\Network\Connections mkdir %userprofile%\AppData\Roaming\Microsoft\Network\Connections\pbk cls rem Copy new rasphone.pbk to user network profile /zaib rem cd %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\ rem ren rasphone.pbk rasphone.pbk.old copy c:\aa-rasphone.pbk %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\ rem ### Create Network Connection Center Icon on Desktop /zaib rem ### I coulnd't found a way to create shortcut of dialer on desktop, someone please suggest set linkName=AA-Network Connections set linkPath=%userprofile%\desktop set program=C:\WINDOWS\SYSTEM32\ncpa.cpl set workDir=C:\WINDOWS\system32 set iconfile=%SystemRoot%\system32\SHELL32.dll set icon=-18 set windowStyle=2 echo Set oWS = WScript.CreateObject("WScript.Shell") > temp.vbs echo sLinkFile = "%linkPath%\%linkName%.LNK" >> temp.vbs echo Set oLink = oWS.CreateShortcut(sLinkFile) >> temp.vbs echo oLink.TargetPath = "%program%" >> temp.vbs echo oLink.IconLocation = "%iconFile%, %icon%" >> temp.vbs echo oLink.WindowStyle = "%windowStyle%" >> temp.vbs echo oLink.WorkingDirectory = "%workdir%" >> temp.vbs echo oLink.Save >> temp.vbs WScript.exe temp.vbs del temp.vbs rem # rem ### Show Popup Message box after everything completed /zaib rem # 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