How do I configure the Cisco VPNUI client as a shortcut to open a specific host? As far as I can tell, the program doesn't take an command line arguments, or does it?

The problem is that the VPNUI.exe doesn't remember a history of VPNs you have connected to in the past, as most other software programs would do.


Yeah, looks like AnyConnect's GUI is completely ignorant of what's on the command line.

I can think of a couple options:

  1. Avoid the UI completely, and use vpncli.exe that's included by AnyConnect's installer
  2. Wrap a batch file around the vpnui.exe launch, swapping out the preferences.xml file with one containing the desired host. (on win7, my preferences.xml is in my profile at AppData\Roaming\Cisco\Cisco AnyConnect VPN Client)
  • I tried that suggestion. While the vpncli.exe works from the command line, I am unable to get it to load a profile.xml, preferences.xml, nor a AnyConnectProfile.xml from the C:\Program Files\Cisco\Cisco AnyConnect VPN Client\ directory . Anyone know how to do this? – djangofan Jul 6 '11 at 23:28
  • 2
    To clarify, it was two separate suggestions; the UI client is the only thing that's gonna pay attention to preferences.xml, while the CLI client's configuration is all dictated by the command line (so, if you want, you can write a bunch of batch files running vpncli.exe connect host.domain.com). – Shane Madden Jul 7 '11 at 0:54
  • Yep, that works. Thanks. There was no need to edit any .xml file as far as I can tell. Just "vpncli.exe connect hostname" . – djangofan Jul 11 '12 at 18:23
  • I know this is an old post, I just wanted to say thank you djangofan and Shane for the question/answer. I was hoping it supported some command line arguments, but I ended up doing option #2 and making a .BAT file to handle my preferences.xml. I'm going to look into the vpncli.exe option when I get some time. – Adam Plocher Apr 9 '13 at 21:10

you need to create an usual text file like

connect myvpnhost

save it as myfile.dat (for example) and then call

"%ProgramFiles%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < myfile.dat

I'm having a similar issue however I was able to get multiple profiles by adding a second profile.xml to C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile. The ProgramData folder is/was hidden.

I originally had an AnyConnectVPN.xml file there, which I duplicated and renamed profile.xml with the information for my other connection. However when I run VPNCLI.exe connect <profile name> ... it still prompts for username and password which isn't very helpful...

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.