Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

Shambles1980

Uploaded by

ShambleS1980

Virus scan

Safe to use

About this mod

Bat file installer for Fallout 4 - Texture Optimization Project by torcher

Requirements
Permissions and credits
Changelogs
1.0.3 is now uploaded.
it does everything that was previously done, but now you must drag a folder to select where to save the backups or to tell the bat file where the backups are to restore. (this was a requested feature)

READ THIS PART IF NOTHING ELSE:

You need archive2 which you can get from bethesda as part of the fallout 4 creation kit You can get that HERE
you need to make a free account to login and download, and after installing
you would usually  find the ARCHIVE2 folder in:

"C:\Program Files (x86)\Bethesda.net Launcher\Games\Tools\"
archive 2 is sometimes located in your fallout 4 folder after installing the creation kit.
which is usually:
"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Tools"

The T.O.P folder has to be in the same hard drive as your fallout game. (if your fallout is installed to D:\ then the t.o.p folder needs to be on D:\)

Just follow the instructions on screen when you run the bat file and you should be golden.
Change power shell to CMD window if needed.

Spoiler:  
Show
Right-click on the taskbar and select "taskbar settings" or "properties." in the new window you will see sliders, one is named "replace command prompt with windows power shell"  slide this slider to the left so it is no longer blue. and you ard done.



YOU DO NOT NEED TO READ ANY MORE, BUT THE INFO IS HERE FOR YOU
----------------------
Some other info:

Windows has security features in place so the 1st thing it can do that may cause an issue is to block apps that came from a diferent computer.
You can check this by right clicking the bat file then going to properties. if you see an un-block option in the bottomr right corener.. then that is probably your issue.. just unblock it and run it normaly. do not run it as an administrator..

The reason i say do not run as an admin is because of the second windows issue..
UAC will not allow an elevated bat file to interact with a non elvated app "explorer.exe is not elivated" this means at the very least you cannot drag and drop the folders to get the locations. at the worst it would mean that apps that need to run to do the work will also be unable to function proerly..

So Do not run as an admin, and do un-block the bat.. if you cannot unblock the bat then scrll down and find the code from the bat file in this description and copy and past it in to a text file and save it as a bat file..

Additional notes: READ ME:
Some people have had to change the permisiions on the fallout 4 data folder to allow read and write access.
I have now added this functionality as default behaviour to the bat file. i have also added atribute flags of -r to the ba2 files so they are read and write enabled. V1.0.2 and newer

Some people have also commented that their anti virus application prevents this bat file (or some tool that it uses) from running properly.
there is Nothing i can do about that only advise that you disable your antivirus whilst you are running the process if you have any isues wth it.

as some one requested i added a new choice variable to the bat file that allowed independant optimisation of files 7 and 8.ba2 i have now re worked the options section. you now get an option to optimise 7 and 8.bat even if you chose NOT to optimise vanila files.. (usefull if you optimized vanilla files already and chose not to do 7 and 8, but later decide that you needed to optimise 7 and 8)
That should be about it. Its as optimised as possible now, variables that i had not conciderd but were requested are now added. and folder and file permissions are taken care of.

i also noticed that i had missed a "\" in the previous versions so "DLCrobot" was not geting backed up, this has now been fixed.


-=bat file creation if needed=-

if you do not know how to save a file as a bat file please read the contents of this spoiler:

Spoiler:  
Show

right click in any open space on your computer and select "new >  text document"
open the text document you just created and paste the code found on the description page in to the text document
Now in the top left corner of the text document click "file>save as.."
in the new window at the bottom change "save as type" to "all files *.*"
Enter a filename in the file name box and make sure it ends with .bat "filename.bat"
click save.
You will now have a bat file that is the same as the one you downloaded but it was created on your computer so it will not be blocked


This bat file HAS to be placed in your fallout 4 DATA folder

Please skip down to Needed files section if this is all the info you needed.


V1.0.1a Video

(re-made the video showing the whole process showing exactly what to do, also showing the time started and time finished at the bottom.
V1.0.1.a Was written just to shave off Some time from the whole process. Right now, from start to finish. It takes approx 80mins to back up all the files and optimize all the files "vanilla + all the suported dlc") 'tested on a q6600 stock with 6gb of ram using a mechanical hard drive" faster systems may have better times. I think its mainly down to the hard disk rather than processor speed.





NEEDED FILES

You need archive2 which you can get from bethesda as part of the fallout 4 creation kit You can get that HERE
you need to make a free account to login and download, and after installing you would usually  find the ARCHIVE2 folder in "C:\Program Files (x86)\Bethesda.net Launcher\Games\Tools\"

You also Need the origional mod found  HERE

After you download the mod extract it any where you like,
then run the bat file you downloaded from this page from your fallout 4 data folder. "please check you have enough free
space to back up files on the hard drive as you will get an option to back up." (i would allocate 22gb of freespace. 17.5gb for the backups. and then 5gb should be plenty of free space for the extraction and compression) you can skip the back up if you really feel comfortable in doing that, but if you do
end up with an error you will need to delete all the textures.ba2 files and then have steam validate install to re download them.. (and 17+gb isnt fun to download)

to prevent errors, you MUST have the bat file extracted to your fallout 4 DATA folder.

watch the video if needed the 1st minute or so will show you all you need to know. But the whole process is in the video condenced down to give a reasonable demo of what its like.


What it does


Its a bat file. and all it really does is ask you where all the folders needed for the origional mod to work are (just drag and drop). it asks which of the files you want to optimise are.
it then extracts a single ba2 file to a folder then it copies the correct optimised files to the same folder it extracted the ba2 file too, then recompresses those extracted files as a correctly named  ba2 file. it also moves that new ba2 file to your data folder.
It repeats this for all the ba2 files that can be optimised.
(it does all the steps people seem to struggle with to use the t.o.p mod properly.)
it also skips 2 of the vanilla texture ba2's because they were not added to t.o.p at the time of writing, but to future proof there is an option to optimise those as well (it wont hurt to optimise them whilst t.o.p does not support them it just takes more time for no benifit)

when its done all the texture files will have been optimised properly and be in the correct location.

it also asks you if you want to backs up your origional ba2 files, just incase you want to revert at any time.

Here is the full content of the bat for those who want to check what it does and how it does it.


New bat file with backup selection and a few tweaks
Spoiler:  
Show

@ECHO OFF

REM Header text.

ECHO ------------------------------
ECHO Please Create a backup directory on
ECHO the Hard drive you wish to use
ECHO For backups, You can use the
ECHO fallout folder if you have enough space.
ECHO ------------------------------
pause
cls
ECHO ------------------------------
color f4
echo !!!!WARNING!!!!
ECHO ------------------------------
ECHO T.O.P FOLDER MUST BE ON THE SAME
ECHO HARD DISK AS YOUR FALLOUT 4 GAME
ECHO ------------------------------
ECHO !!!!WARNING!!!!
ECHO ------------------------------
pause
pause

cls
REM Echo Starting code
color 0f
set root=%~dp0
ECHO DRAG YOUR T.O.P FOLDER HERE
ECHO the one With "textures" folder inside.
ECHO IT MUST BE ON THE SAME DRIVE AS fallout 4
set /p top= Then press Enter
ECHO Drag your fallout 4 Data folder here
set /p dat= then press enter
ECHO Drag your Archive2 folder here
set /p arc= then press enter
ECHO Drag A folder to store the backups,
Echo or where you have stored the backups here
set /p bku= then press enter
goto :prep

REM Echo Preperation

:prep
cd /D %dat%
takeown /f %dat% /r /d y
takeown /f %bku% /r /d y
takeown /f %top% /r /d y
takeown /f %arc% /r /d y
cd /d %dat%
attrib -r %dat%\*.ba2
icacls %dat% /reset /t
icacls %dat% /grant:r *S-1-1-0:(OI)(CI)F  /T  /C
icacls %bku% /reset /t
icacls %bku% /grant:r *S-1-1-0:(OI)(CI)F  /T  /C
icacls %top% /reset /t
icacls %top% /grant:r *S-1-1-0:(OI)(CI)F  /T  /C
icacls %arc% /reset /t
icacls %arc% /grant:r *S-1-1-0:(OI)(CI)F  /T  /C
cd /D %dat%
md extr
md ba2
md top
pause
Xcopy %arc%\*.* %dat%\ /e /y
MOVE /Y %top%\Textures .\top\
pause
CLS
goto :choice1

REM Echo choices

:choice1
set /P c=Restore previous backup? [Y/N]?
if /I "%c%" EQU "Y" goto :restore
if /I "%c%" EQU "N" goto :choice2
goto :choice1

:choice2
set /P c=Back up your Ba2 files? [Y/N]?
if /I "%c%" EQU "Y" goto :backup
if /I "%c%" EQU "N" goto :last
goto :choice2

:last
set /P c=Last chance.. Backup? [Y/N]?
if /I "%c%" EQU "Y" goto :backup
if /I "%c%" EQU "N" goto :chvan
goto :last

Rem Echo Backup

:backup
cd /D %bku%
md backup
cd /D %bku%\backup
pause
ECHO this will take some time
ECHO If you see "FILE NOT FOUND"
ECHO That is because you did not have the DLC
pause
XCOPY %dat%\"Fallout4 - Textures1.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures2.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures3.ba2" %bku%\backup /c
ECHO Please remain patient
XCOPY %dat%\"Fallout4 - Textures4.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures5.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures6.ba2" %bku%\backup /c
ECHO Better Safe than Srry
XCOPY %dat%\"Fallout4 - Textures8.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures9.ba2" %bku%\backup /c
XCOPY %dat%\"Fallout4 - Textures7.ba2" %bku%\backup /c
ECHO Back up 90% complete dlc files now
cd /D %dat%\backup
md dlc
cd /D %dat%
XCOPY %dat%\"DLCCoast - Textures.ba2" %bku%\backup\dlc /c
XCOPY %dat%\"DLCNukaWorld - Textures.ba2"  %bku%\backup\dlc /c
XCOPY %dat%\"DLCworkshop01 - textures.ba2" %bku%\backup\dlc /c
XCOPY %dat%\"DLCworkshop02 - textures.ba2" %bku%\backup\dlc /c
XCOPY %dat%\"DLCworkshop03 - textures.ba2" %bku%\backup\dlc /c
XCOPY %dat%\"DLCRobot - Textures.ba2" %bku%\backup\dlc /c
goto :chvan

:chvan
set /P c=Optimize Vanila textures? [Y/N]?
if /I "%c%" EQU "Y" goto :van
if /I "%c%" EQU "N" goto :van1
:chvan

:van1
CLS
ECHO 2 vanila texture files 7.ba2 and 8.ba2
ECHO were not added to T.O.P when i wrote
ECHO this. so are not being optimised
Echo to save time, If there was an update to
Echo T.O.P to include them you can
set /P c=try to optimise any way ? [Y/N]?
if /I "%c%" EQU "Y" goto :van2
if /I "%c%" EQU "N" goto :chofar
goto :van1

:chofar
set /P c=Far harbour Optimize [Y/N]?
if /I "%c%" EQU "Y" goto :far
if /I "%c%" EQU "N" goto :chonuke
goto :chofar

:chonuke
set /P c=Nuke wrld Optimize [Y/N]?
if /I "%c%" EQU "Y" goto :nukeo
if /I "%c%" EQU "N" goto :chwrk
goto :chonuke

:chwrk
set /P c= work shop Optimize [Y/N]?
if /I "%c%" EQU "Y" goto :worko
if /I "%c%" EQU "N" goto :robo
goto :chwrk

:robo
set /P c= robot Optimize [Y/N]?
if /I "%c%" EQU "Y" goto :robo1
if /I "%c%" EQU "N" goto :clean
goto :robo

REM Echo vanila files
:van
cd /D %dat%
move /y .\"Fallout4 - Textures1.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures1.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures2.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures2.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures3.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures3.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures4.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures4.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures5.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures5.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures6.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures6.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures9.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures9.ba2" .\
rd extr /s /q
md extr
)
goto :van1

:van2
cd /D %dat%
move /y .\"Fallout4 - Textures7.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures7.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"Fallout4 - Textures8.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"Fallout4 - Textures8.ba2" .\
rd extr /s /q
md extr
)
goto :chofar

REM Echo DLC

:far
cd /D %dat%
move /y .\"DLCCoast - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCCoast - Textures.ba2" .\
rd extr /s /q
md extr
)
goto :chonuke

:nukeo
cd /D %dat%
move /y .\"DLCNukaWorld - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCNukaWorld - Textures.ba2" .\
rd extr /s /q
md extr
)
goto :chwrk

:worko
cd /D %dat%
move /y .\"DLCworkshop01 - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCworkshop01 - Textures.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"DLCworkshop02 - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCworkshop02 - Textures.ba2" .\
rd extr /s /q
md extr
)

cd /D %dat%
move /y .\"DLCworkshop03 - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCworkshop03 - Textures.ba2" .\
rd extr /s /q
md extr
)
goto :robo

:robo1
cd /D %dat%
move /y .\"DLCRobot - Textures.ba2" .\Ba2\
for /F "delims=|" %%f in ('dir /s/b "Ba2"') DO (
Archive2.exe "%%~dpnxf" -e="extr"
robocopy top extr /s /xl
Archive2.exe "%cd%\extr\textures" -f=DDS -c="%cd%\Ba2\%%~nxf" -r="%cd%\extr"
MOVE /y .\Ba2\"DLCRobot - Textures.ba2" .\
rd extr /s /q
md extr
)
goto :clean

:restore
CLS
ECHO This option is to restore vanila
ECHO textures. You can skip this and
ECHO only restore the DLCs if you want
ECHO If you do skip the Vanila textures
ECHO will not be restored.
set /P c=Restore Vanila textures [Y/N]?
if /I "%c%" EQU "Y" goto :rest
if /I "%c%" EQU "N" goto :restdl
goto :restore

:rest
XCOPY %bku%\backup\"*.Ba2" %dat%\ /c
goto :restdl

:restdl
CLS
ECHO This will restore the DLCs
set /P c=Restore DLC textures [Y/N]?
if /I "%c%" EQU "Y" goto :dlcres
if /I "%c%" EQU "N" goto :clean
goto :restdl

:dlcres
XCOPY %bku%\backup\dlc\"*.Ba2" %dat%\ /c
goto :clean

:clean
MOVE /Y .\top\Textures %top%\
cd /D %dat%
rd extr /s /q
rd ba2 /s /q
rd top /s /q
atrib -r %dat%\*.exe
del Archive2.exe /q /s
del Archive2Interop.dll /q /s
del Microsoft.WindowsAPICodePack.dll /q /s
del Microsoft.WindowsAPICodePack.Shell.dll /q /s

cls

ECHO Hope this helped
ECHO ShambleS1980
pause