Page 1 of 1

Can unregistervm remove ALL VM's?

Posted: 6. Jun 2013, 12:35
by supercrazymark
Hello,

Is it possible to run a command (unregistervm?) in a bat file that will remove ALL VM's from Vortualbox?

unregistervm needs the uuid or name of the VM but I may not know that at the time the bat file is run...

Would it be possible to write a script that loops through all registered VM's and unregister them?

I hope my question makes sense :)

Thank you,

Mark

Re: Can unregistervm remove ALL VM's?

Posted: 6. Jun 2013, 18:45
by noteirak
use vboxmanage list vms to get the list, then vboxmanage unregistervm $vmname in the loop.

Re: Can unregistervm remove ALL VM's?

Posted: 7. Oct 2014, 13:20
by supercrazymark
Sorry to rekindle such an old post but I am now trying to do this.... please could you give an example of how I would use list vms and then loop through the results and unregister each vm?

I am using Windows and writing a bat file that starts the vm.

Thank you,

mark

Re: Can unregistervm remove ALL VM's?

Posted: 7. Oct 2014, 14:29
by noteirak
I'm afraid I don't have a practical example : I only work with Linux for Virtualbox host, so I could give you the Linux command if you so wish, but I'm very useless in Windows batch scripting

Re: Can unregistervm remove ALL VM's?

Posted: 7. Oct 2014, 20:09
by scottgus1

Re: Can unregistervm remove ALL VM's?

Posted: 8. Oct 2014, 15:51
by supercrazymark
Thank you scottgus1 that link looks like it points me in exactly the right direction :D

If I do manage to create working scripts I will post them here....