Skip to content

Instantly share code, notes, and snippets.

@kowith337
Created October 26, 2017 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kowith337/ec06fdf0f4215e4e94770defbae7bff0 to your computer and use it in GitHub Desktop.
Save kowith337/ec06fdf0f4215e4e94770defbae7bff0 to your computer and use it in GitHub Desktop.
Protect your Minecraft launcher profile before install/update mods
@ECHO OFF
echo This will protect your Minecraft launcher profile before installing some mods, such as Forge or OptiFine
echo that try to create new profile and/or change the game version that you want to launch after install.
:choice
set /P c=Press Y to protect or N to unprotect (Y/N)
if /I "%c%" EQU "Y" goto :protect
if /I "%c%" EQU "N" goto :unprotect
goto :choice
:protect
attrib +r %appdata%\.minecraft\launcher_profiles.json
echo Launcher profile has been locked!
pause
exit
:unprotect
attrib -r %appdata%\.minecraft\launcher_profiles.json
echo Launcher profile has been unlocked!
pause
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment