index.html
x
92
92
1
@echo off
2
3
echo Checking for permissions
4
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
5
6
echo Permission check result: %errorlevel%
7
8
REM --> If error flag set, we do not have admin.
9
if '%errorlevel%' NEQ '0' (
10
echo Requesting administrative privileges...
11
goto UACPrompt
12
) else ( goto gotAdmin )
13
14
:UACPrompt
15
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
16
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
17
18
echo Running created temporary "%temp%\getadmin.vbs"
19
timeout /T 2
20
"%temp%\getadmin.vbs"
21
exit /B
22
23
:gotAdmin
24
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
25
pushd "%CD%"
26
CD /D "%~dp0"
27
28
echo Batch was successfully started with admin privileges
29
echo .
30
cls
31
GOTO:menu
32
:menu
33
Title Hyper-V Installer
34
echo Backup wird dringend empfohlen!
35
echo um u.a. Hyper-V spurenlos und sicher zu entfernen.
36
echo --------------------------------------------------
37
echo Was soll das Setup tun?
38
echo 1 Installieren
39
echo 2 Deinstallieren
40
echo 3 Beenden
41
set /p uni= Option in Zahl eintippen:
42
if %uni% ==1 goto :in
43
if %uni% ==2 goto :un
44
if %uni% ==3 goto :ex
45
46
:in
47
cls
48
Title Install Hyper-V
49
50
pushd "%~dp0"
51
52
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
53
54
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
55
56
del hyper-v.txt
57
58
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL /NoRestart
59
60
goto :remenu
61
62
:un
63
cls
64
Title Uninstall Hyper-V
65
66
pushd "%~dp0"
67
68
Dism /online /disable-feature /featurename:Microsoft-Hyper-V-All /NoRestart
69
70
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
71
72
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /remove-package:"%SystemRoot%\servicing\Packages\%%i"
73
74
del hyper-v.txt
75
76
goto :remenu
77
78
:remenu
79
cls
80
echo Möchten Sie den Computer jetzt neu starten?
81
echo 1 Ja
82
echo 2 Nein
83
set /p uni= Option in Zahl eintippen:
84
if %uni% ==1 goto :re
85
if %uni% ==2 goto :ex
86
87
:re
88
shutdown /r /t 0 /f
89
goto :ex
90
91
:ex
92
exit
.bat
1
6
1
pushd "%~dp0"
2
dir /b %SystemRoot%\servicing\Packages*Hyper-V*.mum >hyper-v.txt
3
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
4
del hyper-v.txt
5
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
6
pause
DISM /Online /Disable-Feature /All /FeatureName:Microsoft-Hyper-V