Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you, when making a different choice than 0, that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2. So we stay on the safe side with (echo 0).)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

Update: This works, found via http://stackoverflow.com/a/29747723/880783https://stackoverflow.com/a/29747723/880783:

(echo connect your.host.name^& echo 0^& echo yourUserName^&echo yourPassWord^&rem.) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you, when making a different choice than 0, that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2. So we stay on the safe side with (echo 0).)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

Update: This works, found via http://stackoverflow.com/a/29747723/880783:

(echo connect your.host.name^& echo 0^& echo yourUserName^&echo yourPassWord^&rem.) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you, when making a different choice than 0, that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2. So we stay on the safe side with (echo 0).)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

Update: This works, found via https://stackoverflow.com/a/29747723/880783:

(echo connect your.host.name^& echo 0^& echo yourUserName^&echo yourPassWord^&rem.) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

added 343 characters in body
Source Link
bers
  • 1.7k
  • 1
  • 22
  • 30

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you, when making a different choice than 0, that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2. So we stay on the safe side with (echo 0).)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

Update: This works, found via http://stackoverflow.com/a/29747723/880783:

(echo connect your.host.name^& echo 0^& echo yourUserName^&echo yourPassWord^&rem.) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2.)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you, when making a different choice than 0, that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2. So we stay on the safe side with (echo 0).)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

Update: This works, found via http://stackoverflow.com/a/29747723/880783:

(echo connect your.host.name^& echo 0^& echo yourUserName^&echo yourPassWord^&rem.) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

added 267 characters in body
Source Link
bers
  • 1.7k
  • 1
  • 22
  • 30

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2.)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

I use something along these lines:

set FILE=%TEMP%\tmp
echo connect your.host.name> %FILE%
(echo 0)>> %FILE%
echo yourUserName>> %FILE%
echo yourPassWord>> %FILE%
"C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s < %FILE%

(Update: Why the parentheses around echo 0? This should remind you that 1> or 2> have a special meaning, redirecting stdout or stderr, respectively - but not echoing 1 or 2.)

This is a little more concise:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord& echo.) > %FILE%
more %FILE% | "C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

However, if you want to achieve the same thing without a temporary file, this does not work for me - I would be interested, why:

(echo connect your.host.name& echo 0& echo yourUserName& echo yourPassWord) | "%ProgramFiles(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" -s

All these variants depend of course on your server's configuration (especially the VPN group you have to chose). To find out what you need to input, call vpncli.exe without any parameters once, start with connect your.host.name, and then note what you are prompted for.

Update: This has the added advantage of offering complete freedom with regard to server, username and password, and does not rely on any sleep values (which is always difficult if your system tends to be busy with something else).

added 267 characters in body
Source Link
bers
  • 1.7k
  • 1
  • 22
  • 30
Loading
Source Link
bers
  • 1.7k
  • 1
  • 22
  • 30
Loading