Skip to content

Commit

Permalink
[minecraft-onedrive] Add screenshots linker
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdotweb committed Jan 5, 2024
1 parent 2f6e36f commit c76fb4b
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions minecraft-onedrive/ScreenshotsLinker.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@echo off

rem TODO: Backup stuff

set /p ScreenshotsOnedrivePath="Enter the path to the folder within your OneDrive folder where you'll keep your screenshots folder, not including the path to OneDrive itself (eg. Games\Minecraft): "

if not defined ScreenshotsOnedrivePath (
echo Please start again and enter something this time.
pause
exit
)

set ScreenshotsFullPath=%userprofile%\OneDrive\%ScreenshotsOnedrivePath%

rem TODO: Presumably we can test if it's a junction and that it points to
rem the right place, in which case we can exit as successful rather than unsure

if exist "%appdata%\.minecraft\screenshots" (
echo There's already a screenshots in %appdata%\.minecraft, please check.
pause
exit
)

if not exist "%ScreenshotsFullPath%\screenshots" (
echo There's no screenshots folder at %ScreenshotsFullPath%, please check.
pause
exit
)

mklink /J "%appdata%\.minecraft\screenshots" "%ScreenshotsFullPath%\screenshots"

chcp 65001 >nul

echo ╔════════════════════════════════════════════════════════════════════════════╗
echo ║ VERY IMPORTANT: ║
echo ║ Go to where the folder of your screenshots is, right-click it, and choose ║
echo"Always keep on this device". It might get corrupted if you don't! ║
echo ╚════════════════════════════════════════════════════════════════════════════╝

pause

0 comments on commit c76fb4b

Please sign in to comment.