Batch Command To Restart Hyper-V

December 10th, 2015 by

Microsoft Dynamics GPI got a new laptop at work recently (i7 16GB RAM 1080P) and have finally been able to pretty much transition away from VMWare to Hyper-V (which I use at home for my test system); I only have a final couple of VMs to recreate or migrate. It has not all been smooth sailing however, as I have found that if the laptop goes to sleep or is switched off the VMs cannot be started again.

I think this is something to do the AD group policy rather than an inherent problem as my Surface Pro 3 works fine.

The solution is to restart the Hyper-V Virtual Machine Management service, but going into Services every time for this was soon going to get annoying, so instead I created a batch file I can run from a keyboard shortcut containing the following two lines:

net stop vmms
net start vmms

These commands stop and then start the service allowing me to use the VMs.

Source: azurecurve

Leave a Reply