Advertisement
Combreal

configureUbuntu.bat

May 19th, 2020
1,595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.75 KB | None | 0 0
  1. @echo off
  2. set WSLExec=c:\Users\%username%\UbuntuWSL\ubuntu1804.exe
  3.  
  4. REM runas /trustlevel:0x20000 "cmd /c %WSLExec% install --root"
  5. %WSLExec% install --root"
  6. %WSLExec% run /mnt/c/Users/%username%/UbuntuWSL/install/configureUbuntu.sh %username%"
  7. %WSLExec% config --default-user %username%"
  8.  
  9. copy %WSLExec% c:\Users\%username%\Desktop
  10.  
  11. bash -c ls >nul: 2>nul:
  12. if %ERRORLEVEL% NEQ 0 (
  13.   wslconfig /u Ubuntu-18.04
  14. )
  15.  
  16. bash -c ls >nul: 2>nul:
  17. if %ERRORLEVEL% NEQ 0 (
  18.   call :MessageBox "Something wrong happened during Ubuntu WSL installation"
  19. ) else (
  20.   call :MessageBox "Ubuntu WSL installation is complete"
  21. )
  22.  
  23. del "%~f0"
  24. exit 0
  25.  
  26. :MessageBox
  27. echo wscript.quit MsgBox ("%~1", 0, "UbuntuWSL") > infobox.vbs
  28. wscript /nologo infobox.vbs
  29. del infobox.vbs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement