Jump to content
Sign in to follow this  
m0nkey

Ram drive - a batch file to help you

Recommended Posts

I bought a 780 gtx from a friend, so before I get rid of my two 570gtx cards, I wanted to do some performance tests so I can see the difference better.

One thing I have ran into quite a bit is using ram drives. I have an SSD drive, which made a huge difference over my PATA drive. Better fps and less stutters.

Anyway, I've used ram drives a lot in the past and messed with symlinks a lot, so I figured I would make a quick batch file to automate things.

This batch file requires is commented, but I will explain it here as well.

First, install ram drive software. I used SoftPerfects ram drive, mainly because its free, performs well enough, and I've used many of their products over the years so I trust them.

Next, you have to decide just what you are going to put in the ram drive. The whole game is 10+gb now. I have 16gb of ram but decided to take some others advice and just put in most of the files from the "Addons" directory into the ram drive. My hopes were to (obviously) get better performance but specifically load times and to get rid of some of the "texture stutters", for lack of a better word.

Anywho, what I did was to pick a bunch of files to put on the ram drive, like island files and structure files. I created a directory called "ram_Addons" and moved all these files into that new directory. Some might be cautious and just copy them. Thats fine.

Next I renamed the original "Addons" directory to "hdd_Addons". These are the files that will still load from the physical hdd.

Next I created a ramd drive that would be large enough to house the files that now exist in the "ram_Addons" directory. For me that was almost 8gb, so I made an 8gb ram drive. You must format the ram drive NTFS for this batch file to work (because of the symbolic links). Then you create a directory on the ram drive to hold the files you want to load from ram. In my case I chose to name it the same, "ram_Addons"

Thats about it really. The batch file will ask you for your directories and such. It then copies all files from "ram_Addons" to the ram drive directory you made.

Now here is the trick to it. The batch file makes a junction point so that there is a "virtual" folder named "Addons" in the arma3 directory, exactly as it was originally. This way the game "thinks" its using the correct directory, but in reality many of the files that would normally live there are in memory.

There is a another similar trick too. Since I have some files still on the hdd to be loaded by arma3, I create a symbolic link for all of these files. But this time, the link makes the ram drive think it has the files on itself when in reality they live on the physical hdd.

I did this because I did not want to put all of the files from the Addons directory into ram. Well, mainly for my friends who don't have as much memory as me but still might benefit from certain key files being loaded/read from memory rather than hdd. I don't know yet what the key files are, maybe some kind soul could inform us so we all could try and see what happens.

To remove this, you simply delete the files on the ram drive and the junction point "Addons". Next time you fire the game up, run the batch file first. It takes about 30 seconds for my SSD drive to read 7gb of files into ram, so its not really slowing things down any to do it when I turn my pc on and want to play.

To completely revert to "all original" settings, delete the ram drive, delete the junction point "Addons". Rename the hdd_Addons directory back to just plain "Addons". Move the files from the ram_Addons directory back to the plain "Addons" directory. Delete the ram_Addons directory. All back to normal.

Unless you use an image and such, updates and change won't be held, so be aware of that.

Here is the batch file. I guess I'll say it - use at your own risk - although in developing it I've ran it dozens of times with no mishaps. You decide I suppose :)

@echo off
REM =====================================================================================
REM =========== ArmA 3 Ram Drive Super Nifty and Handy Helper Thing erm, Tool ===========
REM ===========                     by m0nkey - Jan 21, 2014                  ===========
REM =====================================================================================

:: install a ram disk application (I used SoftPerfect one)
:: determine which files from the Addons directory you want to load from ram
:: MOVE these files to a directory that will be copied to the ram drive when you want to play (ie. ram_Addons)
:: RENAME the Addons directory (ie. hdd_Addons) to something. These will be files that load from the hdd
:: create a ram disk that is big enough to house your chosen set of files (ie. those in the ram_Addons directory)
:: this batch file will take care of creating the symbolic links so that arma THINKS the files are on the hdd
:: when they are actually on the ram drive (or however many you moved to the ram_Addons directory)

:: to remove, first delete the directory Addons in the arma 3 directory
:: *remember this is just a symbolic link to the ram drive now*
:: delete all files on ram drive (or delete the ramdrive forcefully)
:: thats it. Next time you want to play, run this batch script again

:: to set things back to "normal" 100%, just rename your hdd_addons directory back to just "Addons"
:: and MOVE the files from the ram_Addons directory back to the now "real" Addons directory

:: set the ram drive letter
set "ram_drive=r"

:: set the ram drive directory that will house the game files
set "ram_dir=ram_addons"

:: set the hdd directory that has game files to be loaded from ram drive
set "ram_files=c:\arma 3\ram_addons"

:: set arma 3 directory
set "arma=c:\arma 3"

:: set the hdd directory that has game files to be loaded from hdd
set "hdd_files=c:\arma 3\hdd_addons"

:: check if ram drive and directory exist
if not exist "%ram_drive%:\%ram_dir%" goto :no_ram_drive

:: check if the hdd directory exists
if not exist "%hdd_files%" goto :no_hdd_dir

:: copy files from hdd to ram drive
start /wait xcopy "%ram_files%" "%ram_drive%:\%ram_dir%"

:: create symbolic links - let ram drive think it has the files that are actually on the hdd
:: these files will actually be loaded from the hdd
for /f "usebackq delims=|" %%f in (`dir /a-d /b "%hdd_files%"`) do mklink "%ram_drive%:\%ram_dir%\%%f" "%hdd_files%\%%f"

:: create symbolic link - make virtual Addons directory that arma will use that points
:: to the ram drive Addons directory
mklink /J "%arma%\addons" "%ram_drive%:\%ram_dir%"

echo.
echo.
echo Ending Main
pause
exit

:no_drive

echo.
echo Did not find %ram_drive%:\%ram_dir%. Exiting.
goto :bye

:no_hdd_dir

echo.
echo Did not find %hdd_files%. Exiting.

:bye
echo.
pause
exit

Share this post


Link to post
Share on other sites

Yeah, people should learn to use ntfs links more, i.e., the mklink (/d) command... I use it a lot for Steam/SSDs/movingstuffouttaprogramfiles...

Didn't use ramdisks any more since ms didn't offer an own application for it (last ramdisk driver was for XP afaik).

Share this post


Link to post
Share on other sites

I put in my 780gtx today, and found the same fps really, but with a much lower vram use and lower gpu useage. Cpu, in my case an i7 2600k @ 4.4g and 16gb ram, the first physical core usually runs at 90% or so. Sometimes the other cores (virtuals too) will go up a bit, maybe to 7% each. I've disabled core parking with a batch file (two files to toggle) and I made one for toggling basic color, which helps a little.

Anyway, I can certainly see a difference and feel it, as my new video card is not at 98% like a single 570 would have been. I had two 570s in sli and the most I could get typically would be 60fps by myself and in coop missions, usually about 30-40. It depends on the mission of course. Each gpu, depending, might use 50-60% gpu cycles and at most, each roughly 256mb vram.

So, the new card is good and all, but the performance should be better. Thats okay, I like the game so much as long as it plays smooth the fps is not an issue.

I found another tweak today, that puts the profile directory in ram. It is supposed to get rid of little "stalls" that happen when something is written to an .rpt file. I have an ssd drive, and started using the -nologs startup parameter, but did find putting the profile in ram helped what little stutter I had to about disappear. So here is a revised batch script which takes care of adding the profile to ram drive.

@echo off
REM =====================================================================================
REM =========== ArmA 3 Ram Drive Super Nifty and Handy Helper Thing erm, Tool ===========
REM ===========                     by m0nkey - Jan 22, 2014                  ===========
REM =====================================================================================

:: install a ram disk application (I used SoftPerfect one)
:: determine which files from the Addons directory you want to load from ram
:: MOVE these files to a directory that will be copied to the ram drive when you want to play (ie. ram_Addons)
:: RENAME the Addons directory (ie. hdd_Addons) to something. These will be files that load from the hdd
:: create a ram disk that is big enough to house your chosen set of files (ie. those in the ram_Addons directory)
:: this batch file will take care of creating the symbolic links so that arma THINKS the files are on the hdd
:: when they are actually on the ram drive (or however many you moved to the ram_Addons directory)

:: to remove, first delete the directory Addons in the arma 3 directory
:: *remember this is just a symbolic link to the ram drive now*
:: delete all files on ram drive (or delete the ramdrive forcefully)
:: thats it. Next time you want to play, run this batch script again

:: to set things back to "normal" 100%, just rename your hdd_addons directory back to just "Addons"
:: and MOVE the files from the ram_Addons directory back to the now "real" Addons directory

:: added code to also put the profile directory into ram drive
:: create directory on ram drive (ie. profile)
:: use that value in the appropriate place below
:: when batch file executes, the original profile directory name is changed, the files are copied
:: to the ram drive and a junction point is made which will point to the ram drive

:: set the ram drive letter
set "ram_drive=r"

:: set the ram drive directory that will house the game files
set "ram_dir=addons"

:: set the ram drive directory that will house the profile files (.rpt files)
set "ram_profile_dir=profile"

:: set the hdd directory that has game files to be loaded from ram drive
set "ram_files=c:\arma 3\ram_addons"

:: set arma 3 directory
set "arma=c:\arma 3"

:: set the hdd directory that has game files to be loaded from hdd
set "hdd_files=c:\arma 3\hdd_addons"

:: check if ram drive addons directory exist
if not exist "%ram_drive%:\%ram_dir%" goto :no_ram_addon

:: check if ram drive profile directory exist
if not exist "%ram_drive%:\%ram_profile_dir%" goto :no_ram_profile

:: check if the hdd files directory exists
if not exist "%hdd_files%" goto :no_hdd_addon

:: check if real arma 3 profile exists
if not exist "%LocalAppData%\arma 3" goto :no_local_profile

:: copy the files to the ram drive
start /wait xcopy "%LocalAppData%\Arma 3" "%ram_drive%:\%ram_profile_dir%" /S

:: rename the original profile directory
rename "%LocalAppData%\Arma 3" "Arma 3-org"

:: create a junction point for arma 3 to use the ram drive
mklink /J "%LocalAppData%\Arma 3" "%ram_drive%:\%ram_profile_dir%"

:: copy files from hdd to ram drive
start /wait xcopy "%ram_files%" "%ram_drive%:\%ram_dir%"

:: create symbolic links - let ram drive think it has the files that are actually on the hdd
:: these files will actually be loaded from the hdd
for /f "usebackq delims=|" %%f in (`dir /a-d /b "%hdd_files%"`) do mklink "%ram_drive%:\%ram_dir%\%%f" "%hdd_files%\%%f"

:: create symbolic link - make virtual Addons directory that arma will use that points
:: to the ram drive Addons directory
mklink /J "%arma%\addons" "%ram_drive%:\%ram_dir%"

echo.
echo.
echo Ending Main
pause
exit

:no_ram_addon
cls
echo.
echo Did not find %ram_drive%:\%ram_dir%. Exiting.
goto :bye

:no_ram_profile
cls
echo.
echo Did not find %ram_drive%:\%ram_profile_dir%. Exiting.
goto :bye

:no_hdd_dir
cls
echo.
echo Did not find %hdd_files%. Exiting.
goto bye

:no_local_profile
cls
echo.
echo Did not find "%LocalAppData%\arma 3". Exiting.

:bye
echo.
pause
exit


Here is a batch file to disable core parking for when you game

powercfg -setacvalueindex scheme_current sub_processor 0cc5b647-c1df-4637-891a-dec35c318583 100
powercfg -setactive scheme_current

Here is a batch file to enable core parking again when you are done gaming

powercfg -setacvalueindex scheme_current sub_processor 0cc5b647-c1df-4637-891a-dec35c318583 5
powercfg -setactive scheme_current

Here is a batch file to toggle basic color of win7

SC START uxsms || SC STOP uxsms

Do note, I put only bare minimum error checking in, so you might want to comment out the @echo if you have issues to see what is going on, and add some pauses at key locations.

Finally, I've tried many of the tweaks going around. Sometimes some of them work, sometimes not. Its annoying, but the way it is. One thing I did find interesting was using the -cpuCount=4 parameter, then setting the affinity to the 4 physical cores. There was no performance gain really. But what did happen was that core0 was not constantly sitting at 90%. In fact it hits an average 60% now, while the other 3 cores float between 35 to 50%. Average cpu % use goes from about 29% without this method to about 35% using this method. Maybe squeezing a tiny bit more cpu cycles for arma, don't know. But I liked it because I can spread the cycles out across many cores rather than just one. I don't know physically where the cores are located on the chip, but I like to think one of them always (like 85% of the time) running at pretty much full speed is not as good for longevity of the cpu as all 4 cores running. I am a heat fanatic though, so who knows.

Share this post


Link to post
Share on other sites

There is no need to use symlinks, you can just load the pbo's like you would load a mod.

Share this post


Link to post
Share on other sites
There is no need to use symlinks, you can just load the pbo's like you would load a mod.

What do you mean? like -mod="path\to\file.pbo" ? And that will load the entire .pbo into memory?

Is there any info on what the files in the addons directory are, like what resources might be in certain naming conventions or which ones would be used the most? I know when I put the majority of them in a ram drive, the entire experience is "smoother" if you will.

Share this post


Link to post
Share on other sites

Just copy the Addons directory to your RAMDRIVE. Then change your -mod=<ramdrive letter>:\Addons . Make sure is first in your -mod line.

You need a 12GB RAMDISK to hold the whole directory.

You want to test that it is reading from the RAMDISK "cut-n-paste" the Addons directory to somewhere else on your hard drive. Then start the game. If if yells at you then it is not reading from the RAMDISK. If the game starts normally then all is good.

Share this post


Link to post
Share on other sites

Thanks.

I found a thread about this for arma2. I haven't got to try it yet but it looks like many said the correct structure would be a directory like @ram_files and inside that a subdirectory of "addons". Then copy this to the ramdrive and the startup parameter should be -mod=<drive>:\@ram_files\addons. I've moved so many files now to ram (8gb) that its pretty easy to tell if they aren't being accessed from ram as nothing works lol.

That thread is long and very informative. Explains a lot, if arma3 still operates in the same fashion. I will be trying out the monitoring application (I think its process monitor but not sure) to see what files get the most IO. There was a spreadsheet going around that could analyze the monitoring logs, might see if that works with arma3 as well.

The performance boost in terms of the micro stuttering is very apparent when using a ram drive. Now I just need to learn what files are accessed the most in given situations. Gladly read some posts on the topics if anybody knows some or just wants to give me some search terms that will get results. Everything I try is 98% non-relevant lol.

Share this post


Link to post
Share on other sites

You don't need that @ram_files. Just <drive>:\Addons. Don't "move" your .pbo files. Just copy them. It will dump back to the hard drive Addons folder to get the files that are not in the RAMDISK Addons folder.

Alot of the RAMDISK programs now have a save/load feature. Once you get your drive setup up you save it. Then if the computer gets rebooted it auto loads your RAMDISK.

Until they move the engine to 64bit this is the best way to play the game.

Edited by Punisher5555

Share this post


Link to post
Share on other sites

Let me see if I get this straight then.

create a ram drive and directory ie. r:\addons

simply copy the files to be read from ram to r:\addons (leaving them in the real addons directory)

use -mod=r:\ (or possibly -mod=r:\addons)

So what happens is what exactly? Since X.pbo lives on ram drive, when -mod= parameter is used, AFTER the process checks its default c:\arma3\addons directory, it THEN processes any -mod parameters, and when it finds the same X.pbo on the ram drive, it references that as the location for the file? Sort of like the last -mod value listed will supercede any prior references?

There is no doubt, for me, that using a ram drive improves performance (not necessarily fps though). I've further found that putting the entire Dta directory to ram is also beneficial, primarily for the file bin.pbo, which has the 2nd highest amount of reads and 3rd highest amount of data being read, on my system anyway. I used process monitor to get a list of files accessed the most.

I also put my localappdata profile directory to ram drive as well. The -nologs parameter, for me, does not stop the .rpt writes from happening. Process monitor verified this, so the profile is in ram now. And the difference is tangible to me.

I was working on a different batch file, but now will have to rewrite it again. I've a number of friends who need some optimization help, which is why I am making a batch file. I don't really need one myself.

Thanks a lot for all the participation and sharing. Much appreciated!

Share this post


Link to post
Share on other sites

For me since I like staying on the Dev Branch I just copy the Addons directory to the RAMDISK everytime there is a Dev update and I want to play. Takes about 2 minutes at most. My RAMDISK program, SuperSpeed RamDisk, creates/keeps my 12GB RAMDISK everytime I boot up.

My -mod line is: -mod=r:\Addons

That is it. ArmA 2 or 3 will read the .pbo files from the -mod first and then if it can't see them there it defaults to the hard drive Addons directory.

Some years ago during early ArmA 1 days I only had 8GB of RAM. Back then I just loaded the island/grass/etc... pbo's into a RAMDISK. The vehicles and such I left in the hard drive.

This is a really simple solution to alot of gripes you hear from players about the BIS games. "I have this super XYZ computer with..... and this game runs like .@#$%...."

Pass the word. This is how to make the game playable.

Maybe someone can make a wiki with a cool procedure and links to free ramdisk programs.

Share this post


Link to post
Share on other sites

I rewrote my batch script. Have to test it tonight.

Essentially (thanks to those sharing here) I've stopped using the symlinks/junctions and started using the -mod method. I tested that last night but did not know you could just leave them in the addons directory and copy them. I'll test that for sure tonight.

I will also test whether the Dta files can just be copied or not, and in general if a -mod parameter will work with them too.

As far as the profiles directory goes, I can only assume that a junction point is the only way to get that to work.

lol, I do have a pretty good rig, and arma3 anyway is a strange beast. But I nailed down what I think is the best performance I am going to get by doing this:

1. copy about 8gb worth of files from "addons" to ram drive. These are the files with the most reads or most amount of data being read. Did not bother doing all files, but could.

2. load Dta directory into ram and make a junction point. The file bin.pbo is 2nd or 3rd in being accessed by arma3, so included it.

3. load profile into ram and make a junction point. Any logging to .rpt files is not a bottleneck any longer.

4. Set the maxlookahead and read values in arma3.cfg to 1 and 1. This actually got me about 10fps more for some reason.

5. disabled hyperthreading in my 2600k. Prior I was using the parameter -cpuCount=4 and setting the affinity manually to the physical cores. This would cause proc0 to use about 70-80% all the time, and the other 3 cores roughly 30-40%. By disabling HT and not using -cpuCount proc0 still uses like 75% but the other 3 cores use like 60%. In fact, my overall cpu use was roughly 30% give or take, now with all the above in place, I am hitting overall cpu of about 60% with some spikes up into the high 80% range. My cpu turbos to about 4.5ghz.

6. the rest comes down to whether I want the cpu or the gpu to take the most load. I don't recall playing a game before that can vary so much whether the cpu or gpu works more or less by raising certain values. But thats what it does, so thats how it is. Currently I have my 780gtx using about 800mb of vram and the game itself uses about 1.8gb of ram, not including the ram drive.

I will test some more things out tonight and give the final batch file I build for my buds. Its a lot easier now for sure after hammering on it all week to find all the tricks and the info given in this thread.

Thanks again.

---------- Post added at 20:28 ---------- Previous post was at 20:24 ----------

For me since I like staying on the Dev Branch I just copy the Addons directory to the RAMDISK everytime there is a Dev update and I want to play. Takes about 2 minutes at most. My RAMDISK program, SuperSpeed RamDisk, creates/keeps my 12GB RAMDISK everytime I boot up.

I've done this in the past, but since I got my SSD drive I make it a habit to keep writes to a minimum any way possible (browers cache is on PATA for example). I could use a PATA drive to write the image to on shut down, but honestly think the reads from the SSD to ram when I want to play are just as fast as writing on shutdown and then load the image on bootup.

Unless of course you want to save any writes to the ram files.

I've tried most all of the ram drives at one point or another over the years. Used to be so anal I would test them for performance. This time around I just used the SoftPerfect one and called it a day.

Share this post


Link to post
Share on other sites

Here is what I have found regarding the ram drive stuff.

As those here suggest, just copying files from the "addons" directory to the ram drive is enough, no linking required. I created ramdrive (r:\addons), copied the chosen files there, and then used -mods=r:\;<the rest of my addons> and it works very well.

I also made r:\dta directory on ram drive and copied contents there as well. It required a bit different approach to get working, that the mod line had to be -mod=r:\;r:\addons;<other addons>. For whatever reason the dta files and addon files would not both be used with just r:\ and the dta files would not be used with r:\dta. It had to be that combination.

I did remove many files from the addons and dta directories after they were copied to ram to make sure they were indeed being read from the ram drive. They were.

I though to also make r:\profile as no matter what I do on my machine, the .rpt files are being written even with the -noLog parameter. Putting them in the ram drive keeps hdd writes/read from affecting anyway.

But what was really interesting is that when I used -profiles=r:\profile in the startup and my dta directory was on the ram drive and using -mod=r:\;r:\addons; my fps was cut in half. I repeated it a half dozen times. Only when using a junction point for the dta and profile directories that reside on the ram drive and stopped using command parameters for those two did my fps go back to normal.

So here is my last batch file for this, unless something new develops. But right now my machine is running arma3 very well.

If anyone should choose to give this a test, you need only run process monitor and create a list of "most read" files that it finds. Then a simple text document with the name

most_read_addons.txt

needs to be created in the root of the arma 3 directory. It would like like this

anims_f_epa.pbo

anims_f_epa.pbo.a3.bisign

cargoposes_f.pbo

cargoposes_f.pbo.a3.bisign

characters_f.pbo

characters_f.pbo.a3.bisign

data_f.pbo

data_f.pbo.a3.bisign

dubbing_radio_f.pbo

dubbing_radio_f.pbo.a3.bisign

Next you create a ram drive large enough to house those files in your list, plus the Dta directory (mine is ~75mb) and your LocalAppData\Arma 3 directory (your profile directory, mine is ~120mb with saves/cache).

Then in the batch file you only need to list the drive letter you gave the ram drive (ie. r ) and the full path to your arma 3 directory (ie. c:\program files\steam\common\apps\arma 3).

Then run the batch file. There are only 3 choises and are pretty self explanatory.

For those who don't know batch and want to know exactly what is happening:

1. create directories on ram drive (addons/dta/profile)

2. copy content from hdd to ram drive

3. rename the dta directory to dta-org and rename the localappdata\arma 3 directory to arma 3-org

4. create junction points for the dta and arma 3 profile directory

5. you must add to your startup, -mod=r:\ (where "r" is your ram drive letter)

When the batch file stops using the ram drive:

1. verify dta-org and arma 3-org exist

2. remove ram drive directories (delete)

3. remove junction points

4. rename dta-org back to Dta and arma 3-org back to arma 3

5. you must remove the r:\ from the -mod=

Here is the batch file.

@echo off
setlocal
:: set the ram drive letter
set "ram_drive=r"
:: set arma 3 directory
set "arma=c:\arma 3"

:assimbegin
cls
echo.
echo.
echo		      Choose
echo.
echo 1. Profile, Dta and Addons to RAM !
echo 2. Profile and Dta to RAM !
echo 3. Stop using RAM - reset to normal !
echo 4. Exit
echo.
set chooseassim=
set /p chooseassim=Enter your choise now.
if not '%chooseassim%' == '' set chooseassim=%chooseassim:~0,1%
if '%chooseassim%' == '1' call :a_use "pbo"
if '%chooseassim%' == '2' call :a_use
if '%chooseassim%' == '3' goto :a_stop
if '%chooseassim%' == '4' exit
goto :assimbegin
pause
exit
:a_use
:: check if ram drive letter exits
if not exist r:\ call :no_ramdrive %ram_drive%
:: create the directories on the ram drive
mkdir "%ram_drive%:\addons"
mkdir "%ram_drive%:\profile"
mkdir "%ram_drive%:\dta"
:: check if real arma 3 profile exists
if not exist "%LocalAppData%\arma 3" call :no_file_found "%LocalAppData%\arma 3"
:: check if real Dta directory exists
if not exist "%arma%\Dta" call :no_file_found "%arma%\Dta"
:: copy the profile to the ram drive
start /wait xcopy "%LocalAppData%\Arma 3" "%ram_drive%:\profile" /S
:: rename the original profile directory
rename "%LocalAppData%\Arma 3" "Arma 3-org"
:: create a junction point for arma 3 to use the ram profile
mklink /J "%LocalAppData%\Arma 3" "%ram_drive%:\profile"
:: copy dta files to ram drive
start /wait xcopy "%arma%\dta" "%ram_drive%:\dta" /S
:: rename dta directory
rename "%arma%\dta" "Dta-org"
:: create a junction point for dta directory
mklink /J "%arma%\Dta" "%ram_drive%:\Dta"

if "%~1" == "" goto :a_use_lite

:: if choosing option #1, check if list of files exists
if not exist "%arma%\most_read_addons.txt" goto :no_list
:: copy specified files to ram drive
set "ad_list=%arma%\most_read_addons.txt"
for /F "delims=" %%a in ('type "%ad_list%"') do copy /Y "%arma%\addons\%%a" "%ram_drive%:\addons"

cls
echo.
echo Profiles, Dta and Addons copied to RAM !
pause
exit

:a_use_lite
cls
echo.
echo Profiles and Dta copied to RAM !
pause
exit

:a_stop
:: if "arma 3-org" not exist, do nothing!!
if not exist "%LocalAppData%\arma 3-org"  call :no_file_found "%LocalAppData%\arma 3-org"
:: if "dta-org" not exist, do nothing!!
if not exist "%arma%\dta-org" call :no_file_found "%arma%\dta-org"
:: remove directories
rmdir "%ram_drive%:\addons" /S /Q
rmdir "%ram_drive%:\profile" /S /Q
rmdir "%ram_drive%:\dta" /S /Q
:: remove the junction points
rmdir "%LocalAppData%\arma 3" /S /Q
rmdir "%arma%\dta" /S /Q
:: rename directories to original
ren "%arma%\dta-org" "Dta"
ren "%LocalAppData%\arma 3-org" "Arma 3"

echo.
echo RAM data has been removed from RAM !
pause
exit

:no_list
cls
echo.
echo Did not find "%arma%\most_read_addons.txt".
echo No Addons files will be copied to ram drive. Exiting now.
goto :bye

:no_file_found
cls
echo.
echo Did not find %~1. Exiting now.
goto :bye

:no_ramdrive
cls
echo Did not find ram drive: %~1
echo.
echo No ram drive found to work with! Exiting now.
goto :bye

:bye
echo.
pause
exit

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×