# Solved: Configure SecureClient and VZAM to connect



## scj6771 (Jan 17, 2002)

What I am looking to do is have a "one click" solution to run Verizon's VZAM, connect, and then fire up the VPN client and do the same.

I have managed to create an ugly looking batch file that will indeed fire up the VPN client and connect using some cli/scc commands.

cd "C:\Program Files\CheckPoint\SecuRemote\bin"
scc setmode cli
scc userpass "username" password
scc connect -p "profile"

If I add the following to the top of that mess it looks like the following and will bring up VZAM and auto connect.

cd "C:\Program Files\Verizon Wireless\VZAccess Manager"
"VZAccess Manager"
cd "C:\Program Files\CheckPoint\SecuRemote\bin"
scc setmode cli
scc userpass "username" password
scc connect -p "profile"

Ugly? Yes!! I know very little about scripting or creating batch files, the above will bring up the VZAM and auto connect for me but how do I:

1. Invoke the next piece (VPN)? It stops after the VZAM process.
2. How could I have the VPN piece wait until VZAM is connected?


----------



## TheOutcaste (Aug 8, 2007)

use Start to start the VZAccess Manager, then it should continue to the next part.
*Start "" "VZAccess Manager"*

Then you might be able to just wait until you can ping a web site like google/yahoo/Verison to verify you are connected, then continue with the VPN connection.


```
:WaitCon
>Nul ping -n 1 -w 1000 google.com
If %Errorlevel% GEQ 1 Goto WaitCon
```


----------



## scj6771 (Jan 17, 2002)

This is exactly what I was looking for! I have tested this connected and disconnected from our wireless connection and it will indeed fire up the VPN once a connection is made. But for the life of me I can not get VZaccess Manager to "start", it will only run if I change to that directory first? If I try the following it will not work:


```
start "C:\Program Files\Verizon Wireless\VZAccess Manager" "VZAccess Manager"
```
If I open a command prompt I have to cd to that folder and then type ""VZAccess Manager" to get it to work.

Anyway, I will keep plugging away at it, and thanks again for that bit of code!


----------



## Squashman (Apr 4, 2003)

You are not using the correct Syntax for the start command. The first set of quotes is used for the TITLE window. It is not for the path.


```
start "" "C:\Program Files\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe"
```


----------



## scj6771 (Jan 17, 2002)

Thanks Squashman for clearing that up for me.

So now I have got the VZAM to start and connect but it seems it's not waiting for the connection to be made before it brings up the VPN client. This is how it looks:


```
start "" "C:\Program Files\Verizon Wireless\VZAccess Manager\Vzaccess Manager"

:WaitCon
>Nul ping -n 1 -w 1000 google.com
If %Errorlevel% GEQ 1 Goto WaitCon

cd "C:\Program Files\CheckPoint\SecuRemote\bin"
scc setmode cli
scc userpass "USERNAME" "PASSWORD"
scc connect -p "PROFILE"
```


----------



## scj6771 (Jan 17, 2002)

Well, I may have spoke to soon!! Looks like it may be working! I will keep you posted. Thanks again.


----------



## Squashman (Apr 4, 2003)

Barring that you don't have some other type of connection to the Internet, it shouldn't fire up the VPN client until the Verizon connection is made.


----------



## scj6771 (Jan 17, 2002)

Thanks to Squashman and TheOutcaste this works perfectly. I do have two other questions regarding this process.

1. Do you think it's possible to run the VZAccess Manager minimized or even hidden?
2. I would like to create another "Disconnect" script. What would be the most effective way to "kill" the VZAccess Manager process? I already have a way to shut down the VPN client.

Thanks again for all your help!

**update***

Actually I found that I could "kill" the process using TASKKILL, however, I need to find a way to disconnect from the aircard first or it will stay connected regardless if VZAM is running or not.

What I really need to do is find me some commands to switch on and off the Qualcomm Gobi 2000 Wireless HS-USB Ethernet Adapter 9205 card and maybe bypass VZAM altogether!!


----------



## TheOutcaste (Aug 8, 2007)

To run Minimized and the /Min switch to the Start command:

```
start "" [B]/Min[/B] "C:\Program Files\Verizon Wireless\VZAccess Manager\Vzaccess Manager"
```
The VZAccess manager may have it's own switcches to run hidden or to disconnect. Try this in a Command Prompt to see if it will list any options:

```
"C:\Program Files\Verizon Wireless\VZAccess Manager\Vzaccess Manager" /?
```
You might be able to disconnect using the *netsh* command.
First need to identify the connection name:
Connect, then issue this command in a Command Prompt:

```
netsh interface show interface
```
It should show the Connection State as Connected, and the Interface Name
Then use that Interface Name in this command:

```
netsh interface set interface name="[COLOR=DarkRed]Wireless Network Connection[/COLOR]" connect=disconnected
```
If that disconnects, you can use that in a batch file along with the taskkill command.


----------



## scj6771 (Jan 17, 2002)

> To run Minimized and the /Min switch to the Start command:


Tried but without success, still runs maximized.



> The VZAccess manager may have it's own switcches to run hidden or to disconnect. Try this in a Command Prompt to see if it will list any options:


This command just ran the program completely ignoring the /? switch. Perhaps there are no "fancy" commands to be used with VZAM?



> You might be able to disconnect using the netsh command.
> First need to identify the connection name:
> Connect, then issue this command in a Command Prompt:


The connection name is called "Internal" but I get the following message when I run the next command you mentioned: "Only WAN interfaces can be connected, disconnected, enabled or disabled."


----------



## TheOutcaste (Aug 8, 2007)

Three strikes and I'm out

Just for grins, might try adding *-hide* (or *--hide*) to the command:


```
start "" "C:\Program Files\Verizon Wireless\VZAccess Manager\Vzaccess Manager" -hide
```
Might try *-?* or *--?* or *--help* instead of */?* as well, or if it has a User Guide, search it for "command line", see if it has any info. I tried downloading the program, but you have to have a Verizon phone number to do so.

Looks like they treat this as a LAN connection instead of WAN.

Tis might work in that case, it will disable the interface, you'd then need to enable it before connecting:

```
netsh interface set interface "Internal" DISABLED
```
Change DISABLED to ENABLED to enable it.


----------



## scj6771 (Jan 17, 2002)

Thanks for your help, I will give these options a try shortly!



> I tried downloading the program, but you have to have a Verizon phone number to do so.


Just enter all zeros and it will take you to the download area. - http://www.vzam.net/

I am using this:


> Lenovo Notebook with global module (Qualcomm 9202) or CDMA module (Sierra Wireless MC5720, MC5725)


 Version 7.2.1 (2420b).


----------



## TheOutcaste (Aug 8, 2007)

I didn't even try a real number let alone a dummy. I'll download it and see if it will install without the hardware and see what I can find later today.


----------



## scj6771 (Jan 17, 2002)

Stumbled across this!

I created a batch file containing these three lines:

rasdial ISPname username password 

The ISPname must match the name of your dial-up as listed in Network Connections, so mine looks like "rasdial "Verizon Wireless - VZAccess" didn't have to enter any username or password, and it just dials #777, so basically it connects without using VZAM.

I will keep you posted.


----------



## scj6771 (Jan 17, 2002)

Ok, this works great and eliminates Verizons bloated VZAM software. But I must bother you one last time. The command window is displayed during this whole process, which isn't a huge deal, but is there a way maybe to suppress that or even better display a "user friendly" message while it is connecting?


```
rasdial "Verizon Wireless - VZAccess"
:WaitCon
>Nul ping -n 1 -w 1000 google.com
If %Errorlevel% GEQ 1 Goto WaitCon
cd "C:\Program Files\CheckPoint\SecuRemote\bin"
scc setmode cli
scc userpass "USERNAME" PASSWORD
scc connect -p PROFILE
```


----------



## Squashman (Apr 4, 2003)

You can launch the batch file from within a Vbscript to hide the cmd window. Trying to Google search to find the code. I have it at home on my PC.


----------



## TheOutcaste (Aug 8, 2007)

I'd totally forgotten about good old Rasdial, good find!

You can run minimized by using a shortcut to the batch file, and setting the shortcut properties to run minimized.
Or put the batch file in a convenient folder and use this little VBScript (save it with a .vbs extension).
Replace the part in red with the path to your batch file
The triple quotes around the path to the batch file are needed

```
'' Runhidden.vbs - Runs a batch file with no visible window
Set objShell = CreateObject ("Wscript.Shell") 
strBatchFile = """[COLOR=DarkRed]C:\Scripts\Test.cmd[/COLOR]"""
objShell.Run strBatchFile, 0, false
```
Put the script in the same folder if you want, and create a shortcut to it on the desktop, then you can change the icon and shortcut name if desired.


----------



## scj6771 (Jan 17, 2002)

Thanks TheOutcaste, exactly what I was looking for. I'm going to mark this as solved, everything is working perfectly!! Thanks to all those who contributed!


----------

