I have tried using a vbs script from the pre command that runs a savestate command for all virtual servers on the host. Works fine from CMD. Backup Exec times out saying not a valid win32 application. Tried to trigger the vbs script with a bat file from the pre command and I get the bat file to run and then the vbs script tries to run but freezes. Permissions issue? vbs script is as follows. Script just does a savestate on VM and compression before backup. After backup job is done I will run startup script to start VM again.
REM Startup
On error Resume next
set ObjVS = CreateObject("virtualserver.application")
Set objVMColl = objvs.VirtualMachines
If objVMColl.Count = 0 Then
Wscript.echo "There are no Virtual Machines detected on this server"
Else
For each objVM in objVMColl
REM Save the server state
Set subVirtualServer = CreateObject("VirtualServer.Application")
set vmVar = subVirtualServer.FindVirtualMachine(objVM.Name)
set vmtask1 = vmVar.Save
call vmtask1.WaitForCompletion(-1)
REM Compact the disk
For each objDrive in objVM.HardDiskConnections
Set objHardDisk = objDrive.HardDisk
Set vmtask1 = objHardDisk.Compact()
Call vmtask1.WaitForCompletion(-1)
Next
Next
End If