Skip to content

Instantly share code, notes, and snippets.

@IlanVivanco
Last active September 7, 2020 15:07
Show Gist options
  • Save IlanVivanco/7a6029f9fb1df943172c4bfdd516e4ba to your computer and use it in GitHub Desktop.
Save IlanVivanco/7a6029f9fb1df943172c4bfdd516e4ba to your computer and use it in GitHub Desktop.
WSL
REM WSL symlink guide here https://dev.to/themartes_/how-to-make-wsl2-even-faster-with-fast-git-28p8
REM ---------------------
REM Now when we have our script we need to run it every time we boot into our machine. We also need to do that with the highest privileges because you need to be an admin to make a symlink from network drive to your base drive.
REM So go ahead and search for Task Scheduler. On the left sidebar you will see Task Scheduler Library. Click on it and on the right sidebar click on Create Task....
REM Now make sure you'll give a name to your task, then write a little description and Check "Run with highest privileges". Also make sure you'll change Configure for: To Windows10
REM Next click on Triggers tab and add new trigger. This will look fairly simple, Just make sure it's like this, and click OK.
REM Next click on Actions add New and Select the .bat script we created earlier with the following code:
REM ---------------------
@echo off
START /B "" pushd \\wsl$\Ubuntu-20.04\
rmdir C:\Users\melio\code /S /Q
mklink /D C:\Users\melio\code Z:\home\ilan\code
Taskkill /IM cmd.exe /F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment