Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM here is how to download a new version of the archive in powershell to C:\Temp, just change 1804 with the desired version :
- REM powershell -command "Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile C:\Temp\ubuntu.zip -UseBasicParsing"
- REM then upload the new version of the archive to the file set WSL-Ubuntu
- @echo off
- set WSLExec=ubuntu1804.exe REM version change here
- if not exist "C:\Windows\System32\bash.exe" (
- dism /online /Enable-Feature /featurename:Microsoft-Windows-Subsystem-Linux /All
- shutdown /r /t 0
- )
- for /f "tokens=3 delims= " %%a in ('reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage') do (
- if [%%a] EQU [0409] (for /f "tokens=3" %%a in ('net config workstation^|find "User name"') do set theUserName=%%a)
- if [%%a] EQU [040C] (for /f "tokens=3" %%a in ('net config workstation^|find "Nom d'utilisateur"') do set theUserName=%%a)
- )
- if not exist "c:\Users\%theUserName%\UbuntuWSL\" mkdir c:\Users\%theUserName%\UbuntuWSL
- cd c:\Users\%theUserName%\UbuntuWSL
- copy %~dp0NAT_APP_InstallWSL.sh
- tar -xf "%~dp0ubuntu.zip"
- %WSLExec% install --root
- %WSLExec% run /mnt/c/Users/%theUserName%/UbuntuWSL/NAT_APP_InstallWSL.sh %theUserName%
- %WSLExec% config --default-user %theUserName%
- bash -c ls >nul: 2>nul:
- if %ERRORLEVEL% NEQ 0 (
- wslconfig /u Ubuntu-18.04 REM version change here
- )
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement