我使用 Cisco vpn 客户端连接一些客户
Vpnclient.exe 需要回答“您是否希望继续”的问题(是/否)
是否可以无疑问地运行 vpnclient.exe?(静默模式)(我不想要交互模式)
我的目标是自动化 vpnclient.exe,无需交互问题
第二种方法是使用 VB 脚本,如果我的第一个问题无法解决,它可以用“是”字符串回答问题
然后请建议如何使用 VB 脚本自动执行此过程(我需要示例)
来自我的 CMD 窗口的示例
C:\Program Files\Cisco \VPN >vpnclient.exe connect "customor”
Cisco Systems VPN Client Version 5.0.01.0600
Copyright (C) 1998-2007 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Windows, WinNT
Running on: 5.1.2600 Service Pack 2
Config file directory: C:\Program Files\Cisco \VPN \
Initializing the VPN connection.
Contacting the gateway at 33.211.101.20
Negotiating security policies.
Securing communication channel.
============================================================================
THIS IS THE HIGHLY RESTRICTED AREA!
PROPERTY OF UNITEL LTD COMPANY
All access attempts are logging with immediate alerting of security staff
============================================================================
Do you wish to continue? (y/n):
用法:
Usage:
vpnclient connect <profile> [user <username>] [eraseuserpwd | pwd <password>]
[nocertpwd] [cliauth] [stdin] [sd]
vpnclient disconnect
vpnclient stat [reset] [traffic] [tunnel] [route] [firewall] [repeat]
vpnclient notify
vpnclient verify [autoinitconfig]
vpnclient suspendfw
vpnclient resumefw
。
ini文件
[main]
ClientLanguage=
[GUI]
WindowWidth=600
WindowHeight=330
WindowX=189
WindowY=43
VisibleTab=0
ConnectionAttribute=0
AdvancedView=1
LogWindowWidth=0
LogWindowHeight=0
LogWindowX=0
LogWindowY=0
DefaultConnectionEntry=jhdgfgs
答案1
终于找到了答案。这是最简单的一个。我不得不搜索很多地方来自动化连接过程!
尝试以下命令:
echo y | vpnclient.exe connect (Type Profile Name here) user (Type User Name here) pwd (Type Pwd here) nocertpwd stdin
如果这不起作用,请尝试 exe 的完整路径。例如:
echo y | "C:\Program Files\Cisco Systems\VPN Client\vpnclient.exe" connect abcd user hello pwd wassup nocertpwd stdin
答案2
您可以使用vpnclient.ini
与上述文件夹中相同的文件这里. 基本上,示例是这样的:
[Main]
AutoInitiationEnable=1
AutoInitiationRetryInterval=3
AutoInitiationList=ChicagoWLAN,DenverWLAN,LaramieWLAN
[ChicagoWLAN]
Network=110.110.110.0
Mask=255.255.255.0
ConnectionEntry=Chicago (points to a connection profile named chicago.pcf)
[DenverWLAN]
Network=220.220.220.0
Mask=255.255.255.0
ConnectionEntry=Denver (points to a connection profile named denver.pcf)
[LaramieWLAN]
Network=221.221.221.0
Mask=255.255.255.0
ConnectionEntry=Laramie (points to a connection profile named laramie.pcf)
这AutoInitiationEnable=1
是重要的一点,可能会绕过该提示。不过,我无法测试这一点以确保这一点。
答案3
mchen98006:修改文件
C:\Program Files (x86)\Cisco Systems\VPN Client\Profiles\mchen.pcf
代替:
SendCertChain=1
和
SendCertChain=0