SRL Archive - General

DarkStalker's RANDOM.DAT Batch File Deleter


drkstlkr

2007-10-04 15:34:51

DarkStalker's (drkstlkr) RANDOM.DAT Deleter
Batch Files
[LEFT]
Here's my two-cent contribution to the RuneScape community! :)
[LEFT]
I wasn't sure where to post this, so please don't get angry if this post needs to be moved or deleted! :confused:

Ok, I know this place is mostly for SRL scripts, but with many people wanting an easy way to delete the RANDOM.DAT file(s), I decided to make a couple of simple DOS batch files that do it for you. Since Jagex may store the RANDOM.DAT file in numerous different folders, and different Windows versions have slightly different folder names and locations, these batch files simply scans the entire hard disk drive C:, which is the most common drive where Windows is stored, and deletes the RANDOM.DAT file(s) for you.

I personally run a dual-boot system, with Microsoft Windows Vista Ultimate 64-bit running on my hard disk drive C:, and Microsoft Windows XP Professional with Service Pack 2 32-bit edition on hard disk drive J:. Even while playing RuneScape in XP, Jagex still stores the RANDOM.DAT file on my hard disk drive C:. So, hopefully, these batch files should work for most people.

Why an ugly, text-only DOS batch file? For a few reasons:
1. Doesn't require a degree to write or edit a DOS batch file. Anyone can edit them using any text editor, such as Notepad, to suite their personal configurations and needs.
2. Compatible with almost all versions of Windows (tested and works on both
Windows XP Pro w/ SP2 32-bit and Vista Ultimate 64-bit editions).
3. View with any text editor, such as Notepad, and run these batch files with confidence, knowing that these batch files won't purposefully try to sabotage your computer in any way.

Two Different Versions:
dRandomA.bat (Advanced): Scans your hard disk drive C: first and allows you to stop before deleting all of the RANDOM.DAT files found. (safer)
dRandomB.bat (Basic): Doesn't scan your hard disk drive C: and automatically deletes all of the RANDOM.DAT files found. (faster)

Since some programs use a RANDOM.DAT file to function properly, I highly recommend running "dRandomA.bat" first to see all of the RANDOM.DAT files stored on your hard disk drive C: before deciding to delete them all. You may also Google "random.dat" to see what programs may use this file. Once you can determine you don't have any programs (outside of RuneScape, of course) that uses RANDOM.DAT files, then you may use "dRandomB.bat" afterwards. However, due to the nature of these batch files, I will NOT be held responsible for any accidentally deleted files! Use at your own risk!

Please let me know what you think! :D

[/LEFT]

[/LEFT]

Harry

2007-10-04 15:38:11

I'll check it out. Hope it is clean :\

drkstlkr

2007-10-04 15:43:47

From: Hy71194
I'll check it out. Hope it is clean :\


Heheheh… they're clean. They're just two DOS batch files that can be easily viewed and edited with any text editor, such as Notepad. I thought about writing them in something like VisualBasic, but I know I'm always weary of running unknown programs. So, I decided to keep them simple, easily viewed and edited as Jagex likes to change filenames and the such, and can be easily ran on virtually almost any computer running something made from Micro$oft.

:redface:

mastaraymond

2007-10-04 16:55:50

Well done.

drkstlkr

2007-10-04 17:28:35

From: mastaraymond
Well done.


Thanks! I know they're not much, but they do the job.

I wish there was an easier way to incorporate variables and choices in the batch files so that people can pick the drive letter Windows is installed on without having to use the Command Prompt (yes, I have actually seen a Windows partition installed on a different drive letter than C: from from the manufacturer), but Windows XP or Vista doesn't support those commands anymore. :mad:

I suppose the real test is for someone who has a single version of Windows installed on a different drive other than C:, or a dual-boot system where another OS, such as Linux, is installed on drive C: instead. Those instances is where I wish I could add the above commands in the batch files.

Oh well, what can you do? Blasted Micro$oft! :duh:

richk1693

2007-10-04 19:37:08

Sorry but till someones specifically says its good i wont use it. No offense to you but i fear anything ending in .bat

Johura

2007-10-04 22:47:28

Right click it. Then edit. Look at the coding.

kingarabian

2007-10-05 05:09:01

Nice work just tried it out, i looked at the path and they all had jagex in it so i let it delete. Its nice and safe.

Pancakes

2007-10-05 05:53:41

Good job, found it useful :)

Dark_Sniper

2007-10-06 12:59:28

From: richk1693
Sorry but till someones specifically says its good i wont use it. No offense to you but i fear anything ending in .bat



its safe.

very nice :p you got some advertising going down in there to :p

no matter

Jackrawl

2007-10-06 18:48:31

Blegh, I mis-hit it. Is there a way to change my vote? It worked fine. =/

nething

2007-10-08 02:25:20

Nice. Unfortunately I'm not going to use it. But thanks. This helped me alot because I have been trying to learn more about cmd.exe and batch files. Thanks to this and Microsoft.com I think I actually made a pretty good Random.dat deleter. Mine that I made was REALLY simple before because I didn't know much about this stuff. The old one looked like this:

del c:\WINNT\.jagex_cache_32\random.dat
del c:\WINDOWS\.jagex_cache_32\random.dat
del c:\.jagex_cache_32

now looks like this:

@ECHO OFF
CLS
ECHO ===========================================================================
ECHO.
ECHO STEP #1:
ECHO --------
ECHO.
ECHO Please close all instances (windows) of RuneScape before continuing!
ECHO.
ECHO ===========================================================================
ECHO.
PAUSE
CLS
ECHO ===========================================================================
ECHO.
ECHO STEP #2:
ECHO --------
ECHO Deleting Random.dat
ECHO.
ECHO ===========================================================================
ECHO.
IF EXIST c:\WINNT\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\WINNT
IF EXIST c:\WINNT\.jagex_cache_32\random.dat ( del c:\WINNT\.jagex_cache_32\random.dat ) ELSE echo Random.dat wasn't found on c:\WINNT
IF EXIST c:\WINDOWS\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\WINDOWS
IF EXIST c:\WINDOWS\.jagex_cache_32\random.dat ( del c:\WINDOWS\.jagex_cache_32\random.dat ) ELSE echo Random.dat wasn't found on c:\WINDOWS
IF EXIST c:\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\.jagex_cache_32
IF EXIST c:\.jagex_cache_32\random.dat ( del c:\.jagex_cache_32 ) ELSE echo Random.dat wasn't found on c:\.jagex_cache_32
ECHO.
ECHO.
PAUSE
EXIT

Basically checks to see if it is there. If it is there it will say that it deleted it. Next line it will check if it is there and if it is it will delete. If it is not there is will say it couldn't find it. Took me a long time to figure out how to make it say that it was deleted. Ended up making it check for it before it deleted it and it would say that it deleted it before it actually deletes it.

Thanks again :)

Rikje

2007-10-08 15:04:28

nice work ;). i like it.
but it tooks a bit long because you need to puss a bit much the enter key :p.

drkstlkr

2007-10-09 11:57:05

From: rikjess
nice work ;). i like it.
but it tooks a bit long because you need to puss a bit much the enter key :p.


Heheheheh… that's why I made 2 versions. Once you find out you don't have any other programs that uses RANDOM.DAT files, then it's probably safe to use the "
dRandomB.bat" file until you install a new program, and may wanna use "dRandomA.bat" just to see if it uses a RANDOM.DAT file. The "dRandomB.bat" requires much less user input. You simply run it, wait a few, and it automatically exits. Done and done.:)


drkstlkr

2007-10-09 12:05:38

From: nething
Nice. Unfortunately I'm not going to use it. But thanks. This helped me alot because I have been trying to learn more about cmd.exe and batch files. Thanks to this and Microsoft.com I think I actually made a pretty good Random.dat deleter. Mine that I made was REALLY simple before because I didn't know much about this stuff. The old one looked like this:

del c:\WINNT\.jagex_cache_32\random.dat
del c:\WINDOWS\.jagex_cache_32\random.dat
del c:\.jagex_cache_32
now looks like this:

@ECHO OFF
CLS
ECHO ===========================================================================
ECHO.
ECHO STEP #1:
ECHO --------
ECHO.
ECHO Please close all instances (windows) of RuneScape before continuing!
ECHO.
ECHO ===========================================================================
ECHO.
PAUSE
CLS
ECHO ===========================================================================
ECHO.
ECHO STEP #2:
ECHO --------
ECHO Deleting Random.dat
ECHO.
ECHO ===========================================================================
ECHO.
IF EXIST c:\WINNT\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\WINNT
IF EXIST c:\WINNT\.jagex_cache_32\random.dat ( del c:\WINNT\.jagex_cache_32\random.dat ) ELSE echo Random.dat wasn't found on c:\WINNT
IF EXIST c:\WINDOWS\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\WINDOWS
IF EXIST c:\WINDOWS\.jagex_cache_32\random.dat ( del c:\WINDOWS\.jagex_cache_32\random.dat ) ELSE echo Random.dat wasn't found on c:\WINDOWS
IF EXIST c:\.jagex_cache_32\random.dat echo Deleted Random.dat on c:\.jagex_cache_32
IF EXIST c:\.jagex_cache_32\random.dat ( del c:\.jagex_cache_32 ) ELSE echo Random.dat wasn't found on c:\.jagex_cache_32
ECHO.
ECHO.
PAUSE
EXIT
Basically checks to see if it is there. If it is there it will say that it deleted it. Next line it will check if it is there and if it is it will delete. If it is not there is will say it couldn't find it. Took me a long time to figure out how to make it say that it was deleted. Ended up making it check for it before it deleted it and it would say that it deleted it before it actually deletes it.

Thanks again :)


Yeah… I thought about making it very specific to certain folders so that it's faster, but as we all know how Jagex likes to change stuff up. So, keeping this in mind, if Jagex decides to change filenames and/or folders, keeping it "open-ended" eliminates having to update your batch file as often. With mine, all I have to do is just replace the filename if they decide to change it again. I'm not sure how fast this batch file runs on other people's computers, but it only takes about 5 seconds for the "dRandomB.bat" to run on mine. But, I'm glad someone who's wanting to learn more about batch files found it useful. I personally stink at writing scripts, but batch files… been doing that since MS-DOS 3.3 and Windows 3.1 was common on new computers at the time.
:D

NoUserName

2007-10-26 10:39:04

job well done it even worked with shitasta

[vista]

mark9510

2007-11-02 20:39:20

uhh not so bad could be better

drkstlkr

2007-11-03 11:12:02

From: mark9510
uhh not so bad could be better


Yeah, it could've been better if WinXP/Vista supported all of the old DOS functionality, such as "IF ERRORLEVEL" and the such. Outside of that, not much more you can do with DOS batch files.

Why don't ya write something better? :-)