Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :start
- set WSLExec=c:\Users\%username%\UbuntuWSL\ubuntu1804.exe
- rem runas /trustlevel:0x20000 "cmd /c %WSLExec% install --root"
- %WSLExec% install --root"
- %WSLExec% run /mnt/c/Users/%username%/UbuntuWSL/install/configureUbuntu.sh %username%"
- %WSLExec% config --default-user %username%"
- copy %WSLExec% c:\Users\%username%\Desktop
- bash -c ls >nul: 2>nul:
- if %ERRORLEVEL% NEQ 0 (
- wslconfig /u Ubuntu-18.04
- )
- if exist %~dp0marker (
- rem call :MessageBox "Something wrong happened during Ubuntu WSL installation"
- rem call :MessageBox "Ubuntu WSL installation is complete"
- del %~dp0marker
- del "%~f0"
- goto :eof
- )
- bash -c ls >nul: 2>nul:
- if %ERRORLEVEL% NEQ 0 (
- type nul >>%~dp0marker & copy %~dp0marker +,,
- goto start
- ) else (
- call :MessageBox "Ubuntu WSL installation is complete"
- del "%~f0"
- goto :eof
- )
- exit 0
- :MessageBox
- echo wscript.quit MsgBox ("%~1", 0, "UbuntuWSL") > "%~dp0infobox.vbs"
- wscript /nologo "%~dp0infobox.vbs"
- del "%~dp0infobox.vbs"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement