Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- color 03
- ::mode is the consoles window size 55=width, 13=height. Don't go below 13 height, this might result in loss of characters.
- mode 55,13
- title Fallout 4 INI Read only toggle
- :start
- set /a ini1=0
- set /a ini2=0
- set /a ini3=0
- set /a ini4=0
- set /a ini5=0
- cls
- echo [?25h
- if exist %~dp0\fo4SteamPath.bat (
- call %~dp0\fo4SteamPath.bat
- goto next
- ) else (
- cls
- )
- echo Full Fallout 4 Steam path.
- set SteamPath1=NOT SET
- echo [4;2H[0mexample: [7;90mG:\steam\steamapps\common\Fallout 4[0m
- set /p SteamPath1= [2;2H[90mSteam Path:[0m
- (echo set SteamPath=%SteamPath1%) > %~dp0\fo4SteamPath.bat
- set SteamPath=%SteamPath1%
- :next
- if exist %~dp0\fo4MyGamesPath.bat (
- call %~dp0\fo4MyGamesPath.bat
- goto start2
- ) else (
- cls
- )
- set MyGamesPath1=NOT SET
- echo Full Fallout 4 My Games path.
- echo [4;2H[0mexample: [7;90mC:\users\myuser\Documents\My Games\Fallout4[0m
- set /p MyGamesPath1= [2;2H[90mMy Games Path:[0m
- (echo set MyGamesPath=%MyGamesPath1%) > %~dp0fo4MyGamesPath.bat
- set MyGamesPath=%MyGamesPath1%
- :start2
- call %~dp0\fo4SteamPath.bat
- call %~dp0\fo4MyGamesPath.bat
- set /a readOnly=1
- :start3
- echo [?25l
- cls
- if exist "%MyGamesPath%\Fallout4.ini" (attrib +r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
- if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib +r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
- if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib +r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
- if exist "%SteamPath%\Fallout4_Default.ini" (attrib +r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
- if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib +r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
- if %ini1% equ 1 goto missingFiles
- if %ini2% equ 1 goto missingFiles
- if %ini3% equ 1 goto missingFiles
- if %ini4% equ 1 goto missingFiles
- if %ini5% equ 1 goto missingFiles
- echo [1;2HSteam:[97m%SteamPath%[0m
- echo [2;2HMy Games:[97m%MyGamesPath%[0m
- echo [4;2HRead only:
- echo [6;2H1. [90m[Toggle Read only][0m
- echo [7;2H2. [90m[Open directories][0m
- echo [8;2H3. [90m[Change paths][0m
- echo.
- :return
- if %readOnly% equ 1 echo [4;12H[97mON [0m
- if %readOnly% equ 2 echo [4;12H[97mOFF [0m
- echo [10;2H
- echo [11;2H
- choice /c 123 > nul
- if %errorlevel% equ 3 goto paths1
- if %errorlevel% equ 2 goto openDIRS
- if %errorlevel% equ 1 goto attrib1
- :attrib1
- if %readOnly% equ 1 goto attribOFF
- if %readOnly% equ 2 goto attribON
- :attribOFF
- echo [6;2H1. [7m[Toggle Read only][0m
- if exist "%MyGamesPath%\Fallout4.ini" (attrib -r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
- if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib -r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
- if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib -r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
- if exist "%SteamPath%\Fallout4_Default.ini" (attrib -r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
- if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib -r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
- if %ini1% equ 1 goto missingFiles
- if %ini2% equ 1 goto missingFiles
- if %ini3% equ 1 goto missingFiles
- if %ini4% equ 1 goto missingFiles
- if %ini5% equ 1 goto missingFiles
- set /a readOnly=2
- timeout /t 1 /nobreak > nul
- echo [6;2H1. [90m[Toggle Read only][0m
- goto return
- :attribON
- echo [6;2H1. [7m[Toggle Read only][0m
- if exist "%MyGamesPath%\Fallout4.ini" (attrib +r "%MyGamesPath%\Fallout4.ini") else set /a ini1=1
- if exist "%MyGamesPath%\Fallout4Custom.ini" (attrib +r "%MyGamesPath%\Fallout4Custom.ini") else set /a ini2=1
- if exist "%MyGamesPath%\Fallout4Prefs.ini" (attrib +r "%MyGamesPath%\Fallout4Prefs.ini") else set /a ini3=1
- if exist "%SteamPath%\Fallout4_Default.ini" (attrib +r "%SteamPath%\Fallout4_Default.ini") else set /a ini4=1
- if exist "%SteamPath%\fallout4\Fallout4Prefs.ini" (attrib +r "%SteamPath%\fallout4\Fallout4Prefs.ini") else set /a ini5=1
- if %ini1% equ 1 goto missingFiles
- if %ini2% equ 1 goto missingFiles
- if %ini3% equ 1 goto missingFiles
- if %ini4% equ 1 goto missingFiles
- if %ini5% equ 1 goto missingFiles
- set /a readOnly=1
- timeout /t 1 /nobreak > nul
- echo [6;2H1. [90m[Toggle Read only][0m
- goto return
- :openDIRS
- echo [7;2H2. [7m[Open directories][0m
- echo [10;2H[90mOpening dir [97m%SteamPath%[0m
- echo [11;2H[90mOpening dir [97m%MyGamesPath%[0m
- start explorer.exe %SteamPath%
- start explorer.exe %MyGamesPath%
- timeout /t 1 /nobreak > nul
- echo [7;2H2. [90m[Open directories][0m
- goto return
- :paths1
- del %~dp0\fo4SteamPath.bat > nul
- del %~dp0fo4MyGamesPath.bat > nul
- goto start
- :missingFiles
- cls
- echo Steam:[97m%SteamPath%[0m
- echo My Games:[97m%MyGamesPath%[0m
- echo.
- echo [7;90mMissing file^(s^)[0m
- echo.
- if %ini1% equ 1 echo [97mFallout4.ini[0m ^(My Games^) was not found.
- if %ini2% equ 1 echo [97mFallout4Custom.ini[0m ^(My Games^) was not found.
- if %ini3% equ 1 echo [97mFallout4Prefs.ini[0m ^(My Games^) was not found.
- if %ini4% equ 1 echo [97mFallout4_Default.ini[0m ^(Steam^) was not found.
- if %ini5% equ 1 echo [97mFallout4Prefs.ini[0m ^(Steam/Fallout4/^) was not found.
- echo.
- echo Press any key to redo pathing.
- pause > nul
- del %~dp0\fo4SteamPath.bat > nul
- del %~dp0fo4MyGamesPath.bat > nul
- goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement