Batch file to Suspend, Backup and Start a VM under VMWare workstation

To backup a VM running under VMware Workstation, you have to manually shutdown or suspend the VM, manually run a backup and then manually restart the VM.

I hate manual labor! So I set out to fix the problem the best way I know how. Back to the Command Line!

Below is the code for a batch file I wrote (with the help of some folks kind enough to share their code also). I’ve added logging so you can troubleshoot if you need to.

This batch file can be launched using task scheduler and requires local administrator rights to execute properly.

2 Replies to “Batch file to Suspend, Backup and Start a VM under VMWare workstation”

  1. Hi, this doesn’t seem to work when the VM is shared in WS9. What would need to be edited for a shared vm to use this awesome script?

    • I’m using it under WS9. Are you getting any error messages or indications in the log as to why it’s failing?

      You indicated that this is a shared VM. This is not something we do in our environment. I would imagine that you need drop all of the connections to this VM. There is no vmrun command to do this.