So, want to clear that cache automatically every time you start RedM? I got you.
First things first. Let's get familiar with a couple of things:
So, lets make that bat file. I personally keep the bat file inside of the RedM folder, but you can keep it anywhere on your computer
Make the file
Alright, cool, what do those lines do?
Now save and on with the show.
Hope this helps you in your WWRP endeavors. Have fun, be safe, be good, or be good at not getting caught.
First things first. Let's get familiar with a couple of things:
- a .bat file is a text file named with the extension .bat
- a .bat file houses specific text commands native to windows for processing single commands in a batch
- a .bat file once named to the extension .bat, will not be used like a text file anymore. It will try to run the lines of commands within it
- Your RedM folder does not have to be in it's default installation folder. You can copy paste the entirety of the RedM installation where ever you want, and make a new shortcut to it
- Why do this? Clearing your cache deletes the current loaded scripts for the server and forces them to be updated. By doing this, you can avoid a lot of trouble shooting issues and also ensure you have the latest updates for the server scripting.
So, lets make that bat file. I personally keep the bat file inside of the RedM folder, but you can keep it anywhere on your computer
- The default install location for RedM is C:\Users\[YOUR USERNAME]\AppData\Local\RedM
- So, if your username on your computer is todd it would be c:\Users\todd\AppData\Local\RedM
Make the file
- Decide where you want to keep your bat file
- In this example we will be making it inside the RedM folder
- navigate to C:\Users\[YOUR USERNAME]\AppData\Local\RedM
- inside create a text file with any name you choose
- for this example we will name it RedM Run
- Now open this text file and insert the following commands one on each line.
del /s /q C:\Users\[YOUR USERNAME]\AppData\Local\RedM\data\server-cache\*
del /s /q C:\Users\[YOUR USERNAME]\AppData\Local\RedM\data\server-cache-priv\*
cmd /c start "" "C:\Users\[YOUR USERNAME]\AppData\Local\RedM\RedM.exe" -b1491
timeout /t 1
exit
Alright, cool, what do those lines do?
- This command says to delete any file within the folder server-cache = del /s /q C:\Users\[YOUR USERNAME]\AppData\Local\RedM\data\server-cache\*
- This command says to delete any file within the folder server-cache-priv =del /s /q C:\Users\[YOUR USERNAME]\AppData\Local\RedM\data\server-cache-priv\*
- This command tells the computer to run the RedM executable inside the command window with the client version 1491 = cmd /c start "" "C:\Users\[YOUR USERNAME]\AppData\Local\RedM\RedM.exe" -b1491
- This command asks for a 1 second time out. This is here in case an error pops. It gives you a stop point regardless in case of error to hit a key to exit. = timeout /t 1
- This command, because we used cmd /c start, earlier, now allows us to use this one to close the command window = exit
Now save and on with the show.
- Rename the text file extension from .txt to .bat. So RedM Run.txt should now be RedM Run.bat
- As, you can see I created a shortcut to it. This is to test the bat file via a shortcut to make sure admin privileges work on it, in case I/You want it elevated easily (run as admin)
- You can create a shortcut to it, in the same folder by right clicking RedM Run.bat and choosing create shortcut
- There are good security reasons to run admin on a shortcut and not an actual .bat file. If you want to debate it with me do it elsewhere, not here, please.
- On your desktop, right click and choose new shortcut
- Now it will ask for a location
- It really doesn't matter where, as we will be replacing everything, but for practice navigate to your RedM folder
- Click next then name it whatever you want
- Now right click the shortcut and choose properties, it will open a window
- Don't let my picture below confuse you this is my installation but I had no way of editing it to show what we've used so far. Windows is a bitch sometimes.
- As you can see I have the target section highlighted
- You are going to edit that information
- You want to change the target to:
C:\Windows\System32\cmd.exe /c "C:\Users\[YOUR USERNAME]\AppData\Local\RedM\RedM Run.bat"
- You want to change the section "Start in:" to:
C:\Users\[YOUR USERNAME]\AppData\Local\RedM
- Click ok
- Now you have a specialized shortcut on your desktop, and clearing the cache every time
- You can pin this in your start menu or add it to your quick launch
- You can change the icon and set admin privilages or not
Hope this helps you in your WWRP endeavors. Have fun, be safe, be good, or be good at not getting caught.
Last edited by a moderator: