-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest script
More file actions
91 lines (82 loc) · 1.85 KB
/
Copy pathtest script
File metadata and controls
91 lines (82 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
@echo off
:star
cls
echo 1. Reset Elev Konto
echo 2. Kjore Gpupdate
echo 3. Slett Windows Logg
echo 4. Flush DNS
echo 5. Sjekke Ip Adressen
echo 6. Stop Windows Update
echo 7. Start Windows Update
echo 8. Logge Av
echo 9. Restart Maskin
echo 10. Avlutt cmd
set /p userinp=choose a number(1-10):
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto 1
if "%userinp%"=="2" goto 2
if "%userinp%"=="3" goto 3
if "%userinp%"=="4" goto 4
if "%userinp%"=="5" goto 5
if "%userinp%"=="6" goto 6
if "%userinp%"=="7" goto 7
if "%userinp%"=="8" goto 8
if "%userinp%"=="9" goto 9
if "%userinp%"=="10" goto 10
echo invalid choice
goto start
:1
set /p bruker= <C:\Windows\system\user.txt
ntrights.exe -u %bruker% -r SeInteractiveLogonRight
ntrights.exe -u "Brukere" +r SeInteractiveLogonRight
del C:\Windows\system\user.txt
goto start
:2
(gpupdate /force /boot)
goto start
:3
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo Event Logs have been cleared! ^<press any key^>
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:4
(ipconfig /flushdns)
goto start
:5
(ipconfig /all)
:6
net stop wuauserv
pause
:7
net start wuauserv
pause
:8
(shutdown -l)
:9
(shutdown -r -t 60000)
:10
EXIT /B
:end
pause>nul