-
-
Save hose1021/e1aa8d40823e2474263f5f33d5630ff5 to your computer and use it in GitHub Desktop.
Revisions
-
bengarrett revised this gist
Jul 25, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ if "%1" == "/?" goto help1 goto check_Permissions :check_Arguments if /i "%1" == "/on" goto enable if /i "%1" == "/off" goto disable goto err2 :enable echo Enable Hyper-V. -
bengarrett created this gist
Jul 25, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ ::File: c:\terminal\cmd-scripts\hyper-v.cmd @echo off echo. if [%1] == [] goto help1 if "%1" == "/?" goto help1 goto check_Permissions :check_Arguments if /i "%1" == "/on" goto enable if /i "%1" == "/off" goto disable goto err2 :enable echo Enable Hyper-V. bcdedit /set hypervisorlaunchtype auto goto reboot_Request :disable echo Disable Hyper-V. bcdedit /set hypervisorlaunchtype off goto reboot_Request :reboot_Request @echo. echo Please reboot your computer to apply these changes. goto end1 :err1 echo No parameter provided. Please use the following syntax. goto help2 :err2 echo %1 is not a valid parameter. Please use the following syntax. goto help2 :help1 echo Sets the hypervisorlaunchtype in the Boot Configuration Data Store. goto help2 :help2 @echo. echo hyper-v /on - To enable Hyper-V echo hyper-v /off - To disable Hyper-V goto end1 :check_Permissions :: http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights net session >nul 2>&1 if %errorLevel% == 0 ( goto check_Arguments ) else ( echo Please run this script as an Administrator. echo The Boot Configuration Data Store can not be accessed as the user %USERNAME%. goto end1 ) :end1