-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cmd
34 lines (28 loc) · 1.04 KB
/
setup.cmd
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
@echo off
whoami /groups | find "High Mandatory Level" > NUL
if not errorlevel 1 goto RUN
cd "%~dp0"
echo You must elevate to administrator mode, because continue setup.
powershell -Command Start-Process -Verb runas "%~n0"
exit /b %errorlevel%
:RUN
echo.
echo ===[ INSTALL Chocolatey ]==========================================
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
call RefreshEnv
echo.
echo ===[ INSTALL Virtualbox ]==========================================
cinst -y virtualbox -params '"/NoDesktopShortcut"'
echo.
echo ===[ INSTALL Vagrant ]=============================================
cinst -y vagrant
echo.
echo ### Continue to up.cmd. Return to standard user mode. ###
setlocal
set TASK=%RANDOM%
schtasks /Create /TN %TASK% /TR "%~dp0up.cmd" /SC ONCE /ST 00:00
schtasks /Run /TN %TASK%
schtasks /Delete /F /TN %TASK%
endlocal
timeout /T 10
exit /b 0