中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
作者:
标题: [求助]创建VPN的脚本! 上一主题 | 下一主题
renzhen
新手上路





积分 9
发帖 5
注册 2007-7-25
状态 离线
『楼 主』:  [求助]创建VPN的脚本!

求助,请高手帮忙写一个可以自动创建VPN,并能自动拨号的的脚本!
谢谢!

2008-4-14 03:56
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
tvzml
初级用户





积分 157
发帖 67
注册 2007-5-13
状态 离线
『第 2 楼』:  

@echo off
set VPN_LAN=0
findstr /c:"VPN_LAN" "C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk" ||set VPN_LAN=1
@echo %VPN_LAN%
echo set WshShell = CreateObject("WScript.Shell") >VPN_phone.VBS
if %VPN_LAN%==0 goto VPN_ADD
echo WshShell.Run "Rasphone -a" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "%%+T" >>VPN_phone.VBS
echo WshShell.SendKeys "%%+N" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "vpn.isp99.com" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "%%+N" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "VPN_LAN" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "{ENTER}" >>VPN_phone.VBS
echo WScript.Sleep 50 >>VPN_phone.VBS
echo WshShell.SendKeys "{ENTER}" >>VPN_phone.VBS
:VPN_ADD
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.Run "Rasphone -d VPN_LAN" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.AppActivate "连接 VPN_LAN" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "%%+u" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "ID" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "%%+p" >>VPN_phone.VBS
echo WScript.Sleep 500 >>VPN_phone.VBS
echo WshShell.SendKeys "PWD" >>VPN_phone.VBS
echo WScript.Sleep 100 >>VPN_phone.VBS
echo WshShell.SendKeys "%%+c" >>VPN_phone.VBS
start VPN_phone.VBS

2008-4-14 05:28
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dyzztxb
新手上路





积分 14
发帖 8
注册 2009-8-30
状态 离线
『第 3 楼』:  谢谢

找这个好久了
太感谢了

2010-3-13 12:18
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: