建立.bat腳本分別放入以下兩端代碼
備份.bat
@echo off
set source1="C:\Users\%USERNAME%\AppData\Roaming\Code"
set target1=".\Code"
set source2="C:\Users\%USERNAME%\.vscode"
set target2=".\.vscode"
xcopy "%source1%" "%target1%" /e /y /d /i
xcopy "%source2%" "%target2%" /e /y /d /i
還原.bat
@echo off
set source1=".\Code"
set target1="C:\Users\%USERNAME%\AppData\Roaming\Code"
set source2=".\.vscode"
set target2="C:\Users\%USERNAME%\.vscode"
xcopy "%source1%" "%target1%" /e /y /d /i
xcopy "%source2%" "%target2%" /e /y /d /i