I am trying to make a batch script that automates login in and out of Cisco Anyconnect. I noticed that Anyconnect comes with a CLI application which should make this easy to do. However, my issue is that the CLI app requires me to provide input over multiple session. The flow is the following:
- First I type
connect example.com
and hit enter. Here example.com is the server I wish to connect to. - Then I insert my username and hit enter.
- Lastly, I insert my password and hit enter.
I have read guides on how to pass multiple arguments to a batch script, but it seems that I need to do something extra in order for the arguments to be entered in accordance with the flow, i.e. the arguments should for instance be entered as if the return key is simulated. Is there someone with a suggestion?