The vmware-cmd.pl script is a standard script you can run on the ESX console to do stuff with virtual machines from the command line. For example, to stop a virtual machine, you can use:

vmware.cmd <path_to_vmx> stop

Above, <path_to_vmx> is the path to a virtual machine's vmx file (configuration file) like /vmfs/volumes/vmfs02/vm007/vm007.vmx.

What if you want to stop all the virtual machines on an ESX server or just a subset? In that case, do the following from the command line (one line):

vmware.cmd -l | while read vmxpath; do vmware-cmd $vmxpath stop; done

If you want to do some filtering, you can do something like this:

vmware.cmd -l | grep labsrv | while read vmxpath; do vmware-cmd $vmxpath stop; done

The above command will only perform the stop operations on virtual machines that have labsrv in the vmx filepath.