日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

python pppoe拨号_批处理版普通宽带连接ADSL(PPPOE)创建工具

發(fā)布時間:2024/1/1 python 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python pppoe拨号_批处理版普通宽带连接ADSL(PPPOE)创建工具 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

:: 涉及到 rasphone.pbk 文件的編碼和 find 查找兼容編碼的問題, 此工具生成的寬帶連接名稱不用中文.

:: 關(guān)于兩個鍵值 DialParamsUID, Guid, 本工具不生成, 代由系統(tǒng)自動生成.

:: 打開 ncpa.cpl 刷新查看或 運(yùn)行 rasdial ... 后, 系統(tǒng)會自動生成相關(guān)的鍵值.

:: Guid 的鍵值也可用 MS 的工具 UUIDGEN 來生成, 下載: http://filediag.com/windows/process/Uuidgen.Exe.html

:: PreviewUserPw=1 指定 提示名稱, 密碼和證書等.

@echo off & setlocal enableDelayedExpansion

set phoneBook="%AllUsersProfile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"

set /a num=0& call :findNum num

find "[PPPoE]" !phoneBook!>nul||set "num="

>>!phoneBook! (

echo.&echo [PPPoE!num!]

for /f "delims=" %%a in (%~s0) do (

if /i "%%a"==":end:phoneBook" set getValue=N

if /i "!getValue!"=="Y" (echo %%a)

if /i "%%a"==":phoneBook" set "getValue=Y"

)

)

(set vbsfn="%temp%\scuttemp.vbs")

>!vbsfn! (

for /f "delims=" %%a in (%~s0) do (

if /i "%%a"==":end:genVbs" set getValue=N

if /i "!getValue!"=="Y" (echo %%a)

if /i "%%a"==":genVbs" set "getValue=Y"

)

)

cscript //nologo !vbsfn!

start Control netconnections& rem start ncpa.cpl

start rasphone -d PPPoE!num!

exit /b

:findNum num rem 查找電話本中未用的條目標(biāo)識數(shù)字

find "[PPPoE!%1!]" !phoneBook!>nul||exit /b

set /a %1+=1

goto :findNum

exit /b

:genVbs

Set WshShell = Wscript.CreateObject("Wscript.Shell")

' 創(chuàng)建一個快捷方式對象,其在桌面上設(shè)置相同的名字

strDesktop = WshShell.SpecialFolders("Desktop")

Set oShellLink = WshShell.CreateShortcut(strDesktop & "\\寬帶連接!num!.lnk")

' 設(shè)置快捷方式的執(zhí)行路徑

oShellLink.TargetPath = "rasphone.exe"

oShellLink.Arguments = "-d PPPoE!num!"

REM oShellLink.WindowStyle = 1? ?? ?? ?? ???' 運(yùn)行方式

REM oShellLink.Hotkey = ""? ?? ?? ?? ?? ?? ?' 設(shè)置快捷方式的快捷鍵

oShellLink.IconLocation = "rasphone.exe,0"??' 設(shè)置文件夾快捷方式的圖標(biāo)路徑

oShellLink.Description = "連接寬帶連接 PPPoE!num!"? ?? ?? ?' 設(shè)置快捷方式的描述

oShellLink.WorkingDirectory = "::{7007ACC7-3202-11D1-AAD2-00805FC1270E} :{BA126AD7-2166-11D1-B1D0-00805FC1270E}"? ?' 起始位置

oShellLink.Save

:end:genVbs

:phoneBook

Encoding=1

Type=5

AutoLogon=0

UseRasCredentials=0

BaseProtocol=1

VpnStrategy=0

ExcludedProtocols=3

LcpExtensions=1

DataEncryption=8

SwCompression=1

NegotiateMultilinkAlways=0

SkipNwcWarning=0

SkipDownLevelDialog=0

SkipDoubleDialDialog=0

DialMode=1

DialPercent=75

DialSeconds=120

HangUpPercent=10

HangUpSeconds=120

OverridePref=15

RedialAttempts=3

RedialSeconds=60

IdleDisconnectSeconds=0

RedialOnLinkFailure=1

CallbackMode=0

CustomDialDll=

CustomDialFunc=

CustomRasDialDll=

AuthenticateServer=0

ShareMsFilePrint=0

BindMsNetClient=0

SharedPhoneNumbers=0

GlobalDeviceSettings=0

PrerequisiteEntry=

PrerequisitePbk=

PreferredPort=

PreferredDevice=

PreferredBps=0

PreferredHwFlow=0

PreferredProtocol=0

PreferredCompression=0

PreferredSpeaker=0

PreferredMdmProtocol=0

PreviewUserPw=1

PreviewDomain=0

PreviewPhoneNumber=0

ShowDialingProgress=1

ShowMonitorIconInTaskBar=1

CustomAuthKey=-1

AuthRestrictions=632

TypicalAuth=1

IpPrioritizeRemote=1

IpHeaderCompression=0

IpAddress=0.0.0.0

IpDnsAddress=0.0.0.0

IpDns2Address=0.0.0.0

IpWinsAddress=0.0.0.0

IpWins2Address=0.0.0.0

IpAssign=1

IpNameAssign=1

IpFrameSize=1006

IpDnsFlags=0

IpNBTFlags=0

TcpWindowSize=0

UseFlags=1

IpSecFlags=0

IpDnsSuffix=

NETCOMPONENTS=

ms_server=0

ms_msclient=0

MEDIA=rastapi

Port=PPPoE5-0

Device=WAN 微型端口 (PPPOE)

DEVICE=rastapi

PhoneNumber=

AreaCode=

CountryCode=1

CountryID=1

UseDialingRules=0

Comment=

LastSelectedPhone=0

PromoteAlternates=0

TryNextAlternateOnFail=1

:end:phoneBook

總結(jié)

以上是生活随笔為你收集整理的python pppoe拨号_批处理版普通宽带连接ADSL(PPPOE)创建工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。