Author Topic: Create a batch file to delete game cache files  (Read 58946 times)

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #25 on: April 03, 2012, 04:44:19 PM »
Okay, I'm having some trouble doing this. I'm running Windows 7, but I can't seem to save it as a .bat file. It just saves as CleanSims.bat.txt. I'm not exactly sure what I'm doing wrong. :-\ Could somebody help me?

When you go to save it are you going in the Save as Type drop down menu and changing from .txt files to All Files? If you don't do that is will add the .txt to the file name.
A clear conscience is usually a sign of a bad memory.

Offline MoonsAreBlue

  • Infatuated Fanatic
  • Watcher
  • ******
  • Posts: 1444
Re: Deleting cache files
« Reply #26 on: April 03, 2012, 06:51:19 PM »
That's not what I meant. It won't work that way anyway. You should rename the already created file. Right-click on it and choose "rename" from the list, then delete the .txt part at the end.

Did you do that and did it not work again?

When I rename it, only the name shows up, not the extension.

When you go to save it are you going in the Save as Type drop down menu and changing from .txt files to All Files? If you don't do that is will add the .txt to the file name.

That's exactly what I did, but it still saved it as a .txt file. There's a separate drop-down menu Encoding and the options are ANSI, Unicode, Unicode big endian, and UTF-8. ANSI is default. Should I select any of those?



Registered members do not see ads on this Forum. Register here.

Offline wednesday21

  • Lurker
  • Occult
  • ****
  • Posts: 339
  • Joker is slightly amused.
Re: Deleting cache files
« Reply #27 on: April 03, 2012, 07:00:33 PM »
Gotcha. ;) Here you go. Do that, then go back to the file, rename it and erase the .txt part at the end. That should do it.

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #28 on: April 03, 2012, 07:24:39 PM »
That's exactly what I did, but it still saved it as a .txt file. There's a separate drop-down menu Encoding and the options are ANSI, Unicode, Unicode big endian, and UTF-8. ANSI is default. Should I select any of those?

No, you shouldn't have to change it. It should be ANSI. I don't why it's not working for you.
Let's try a different route. Do you have your folders options set to Hide extensions for known file types? If so change that by
Open Folder Options by clicking the Start button, clicking Control Panel, clicking Appearance and Personalization, and then clicking Folder Options, click on the View tab find the option for Hide extensions for known file types. If there is a check in that box click it to uncheck it then click ok.

Now go back to notepad and after putting in the info for the batch file do a save as and give it a name like Clean Cache and leave everything as default so it saves it as a .txt file.
Now find the file you just saved and right click it and choose rename. Replace txt with bat and hit enter and that should have you set.
I know it's a long way around to do it but I'm not sure why it's not saving right in notepad for you but this should take care of it.

edit: Looks like wednesday21 beat me to it. :)
A clear conscience is usually a sign of a bad memory.

Offline MoonsAreBlue

  • Infatuated Fanatic
  • Watcher
  • ******
  • Posts: 1444
Re: Deleting cache files
« Reply #29 on: April 03, 2012, 07:27:09 PM »
Gotcha. ;) Here you go. Do that, then go back to the file, rename it and erase the .txt part at the end. That should do it.

That did it. Thank you. :)

Offline Seabody

  • Global Moderator
  • Watcher
  • ******
  • Posts: 5088
Re: Deleting cache files
« Reply #30 on: May 13, 2012, 03:07:59 AM »
start /d "C:\Program Files\Electronic Arts\The Sims 3 Ambitions\Game\Bin" Sims3Launcher.exe

Just to be sure, the quotation mark between "Bin" and "Sims3Launcher.exe" is meant to be there, and not at the end, right? :-\ I want to make my .bat file right, because, if I recall correctly, the last time I did it, I did something wrong.

Edit: I tried it and it is meant to be there.

Offline napoleonwrasse

  • Townie
  • ***
  • Posts: 111
  • I'm a long time simmer who mostly builds.
    • Sims 3 Houses and Misc. items
Re: Deleting cache files
« Reply #31 on: June 23, 2012, 04:38:41 PM »
You can also add to this to delete world cache files if your computer uses them by adding lines to it, copying and pasting the script, and following the path to those files.

For now, I have put them in a separate file (but I tested it and it works) since I don't play them often.  But as I'm not familiar with how these things work in windows programming, what happens if the script goes to delete a file that isn't actually there?  Will it create an error, or will the system just ignore that line?

But not on a mac. It causes major issues with the text of the world. I nearly did it make Union cove work, but then double checked on another site and found how problematic it is.



Registered members do not see ads on this Forum. Register here.

Offline angelcat621

  • Happy Cat Servant
  • Llama Wrangler
  • **
  • Posts: 62
  • I'm still here everyone!
Re: Deleting cache files
« Reply #32 on: August 07, 2012, 02:42:10 PM »
In addition to the cache files mentioned in the original post, some people find that their game runs smoother when they delete the contents of the DCBackup (not DCCache, always leave that alone) folder, which is where the game stores a backup of the Store items that are installed. These are not really needed and take up a lot of space. I do this regularly and have not had any issues. Please note, however, that the ccmerged file in this folder should never be deleted if it is present. Doing so can cause Premium items, like the spellbook or deep fryer, to not function properly.
The cat is cryptic, and close to strange things which men cannot see. -H.P. Lovecraft 

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #33 on: August 07, 2012, 04:35:54 PM »
I've added a line to clear the DCBackup folder but leaving the ccmerged.package file.

From what I've seen any content installed puts a file starting with a 0 in the DCBackup folder. The line I've added deletes all files starting with the number 0 so it leaves the ccmerged file alone.
I anyone has seen any files in the DCBackup folder that don't start with a number 0 let me know and I'll see if I can do it differently to take care of them.
A clear conscience is usually a sign of a bad memory.

Offline Posidem

  • Dutch of the Sea
  • Llama Wrangler
  • **
  • Posts: 51
Re: Deleting cache files
« Reply #34 on: September 22, 2012, 08:34:24 PM »
I love you. I love you so much. My game has been running a LOT smoother since I've done this. Thank you! <3

Offline Seabody

  • Global Moderator
  • Watcher
  • ******
  • Posts: 5088
Re: Deleting cache files
« Reply #35 on: September 23, 2012, 03:48:29 AM »
I anyone has seen any files in the DCBackup folder that don't start with a number 0 let me know and I'll see if I can do it differently to take care of them.

Wouldn't it be better to make ccmerged.package read-only, then wipe the rest of them? Someone else posted the code, but off the top of my head, I think it was this:

Code: [Select]
attrib +r "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\"
attrib -r "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #36 on: September 23, 2012, 07:44:48 AM »
Wouldn't it be better to make ccmerged.package read-only, then wipe the rest of them? Someone else posted the code, but off the top of my head, I think it was this:

Code: [Select]
attrib +r "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\"
attrib -r "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"

Yes, that will work just fine. And would take take of any files that might come up that don't start with a zero. But so far it hasn't been a problem.
Like a lot of problems they can have more than one solution. :) Just use the one that works best for you.
A clear conscience is usually a sign of a bad memory.

Offline donatello

  • "Dreamin' dreams to oneday carve in stone..." - Prime Circle
  • Immortal
  • *****
  • Posts: 506
  • Just as well my sims game is unplayable (stupid update issues!) I don't have time these days anyway.
Re: Deleting cache files
« Reply #37 on: September 25, 2012, 06:51:20 PM »
Grimsoul, you do realise you saved my PC from eating bricks for a late night snack right? Thank you so much, this is just awesome!
"Life is not worth living unless lived for someone else" - Albert Einstein
"The only history worth a tinker's dam is the history we made today" - Henry Ford
"If it feels like you have everything under control, you're simply not going fast enough" - Mario Andretti

Offline Sarabi

  • Townie
  • ***
  • Posts: 163
Re: Deleting cache files
« Reply #38 on: November 25, 2012, 09:03:05 AM »
Great idea, grimsoul.  I've been using the batch file for awhile now, and it is very helpful.

Thank you.

Offline Seabody

  • Global Moderator
  • Watcher
  • ******
  • Posts: 5088
Re: Deleting cache files
« Reply #39 on: November 27, 2012, 01:57:31 AM »
I'd like to share my personal batch file. It works on Windows 7, at least:

Code: [Select]
@echo off
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\CASPartCache.package"
echo CASPartCache deleted
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\scriptCache.package"
echo ScriptCache deleted
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\compositorCache.package"
echo compositorCache deleted
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\simCompositorCache.package"
echo simCompositorCache deleted
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\socialCache.package"
echo socialCache deleted
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\Thumbnails"
echo thumbnails cleared
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\WorldCaches"
echo world cache cleaned
attrib +r "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"
echo ccmerged made readonly
del "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\DCBackup"
echo DCBackup cleaned
attrib -r "%USERPROFILE%\Documents\Electronic Arts\The Sims 3\DCBackup\ccmerged.package"
echo ccmerged made readwrite
start /d "C:\Program Files\Electronic Arts\The Sims 3 Seasons\Game\Bin" Sims3Launcher.exe
echo game launching
pause
exit

Basically it deletes every file possible (cache files, DCBackup, Thumbnails and World Caches) and then tells me that it deleted them. It then launches the game, tells me it did that, waits for confirmation, then exits. Best thing is, I don't even need to bother changing Usernames - %USERPROFILE% means your User Profile - so for instance, if my username was "Seabody", it'd mean C:\Users\Seabody - if it was "Orangutan", it'd mean C:\Users\Orangutan.

Offline only_heather

  • NPC
  • *
  • Posts: 1
Re: Deleting cache files
« Reply #40 on: October 03, 2013, 12:32:45 PM »
I keep getting little bugs like the consignment shop not working, missing texture file on the drafting board and find that I have to delete the cache file regularly to to fix them. I've been doing it each time before I start the game and haven't had any problems this way.
So instead of trying to remember to do this each time I made a simple little batch file to take care of it for me and thought that others mid find it useful also.

Open notepad and copy and paste the following into it. You will have to change the directories path if they don't match where your files are. Like if you are using Late Night instead of Ambitions you will have to change that.

Then go to File, Save as... and give it a name like Clean Sims.bat and under the drop down menu for Save as type: change it from Text Documents [*.txt] to All Files then save to the desktop or where ever you want.

When you click the batch file it will run and delete the four cache files then run the Sims.

Edit: Added a line to clear the DCBackup folder but leaving the ccmerged.package file.
From what I've seen any content installed puts a file starting with a 0 in the DCBackup folder. The line I've added deletes all files starting with the number 0 so it leaves the ccmerged file alone.

@echo off
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\CASPartCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\scriptCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\compositorCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\simCompositorCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\0*.package"
start /d "C:\Program Files\Electronic Arts\The Sims 3 Ambitions\Game\Bin" Sims3Launcher.exe



I am an IDIOT!!! I have a degree in information security, you would think I'd double check my scripts... ok
I copied this and found my file locations... however on the DCBackup.. yeah, guess what I did NOT do... I left off the 0*.package part... my CCMERGED is gone... is this bad? I am afraid to open up my game now... crap!!

Offline saltpastillen

  • Watcher
  • ******
  • Posts: 2576
Re: Deleting cache files
« Reply #41 on: October 03, 2013, 02:20:20 PM »
Can you find in in the trash can?

Otherwise you might have to reinstall all your preminum content in order for it to work properly. It might still be in game, but it will not work as before.

Offline Blackrosea

  • Immortal
  • *****
  • Posts: 575
Re: Deleting cache files
« Reply #42 on: October 03, 2013, 04:54:36 PM »


I am an IDIOT!!! I have a degree in information security, you would think I'd double check my scripts... ok
I copied this and found my file locations... however on the DCBackup.. yeah, guess what I did NOT do... I left off the 0*.package part... my CCMERGED is gone... is this bad? I am afraid to open up my game now... crap!!

Welcome to the forum only_heather. 

I personally have deleted the ccmerged.package file and have been fine with playing my game. It should be located in your trash bin if you feel better moving that file back.

Offline sdhoey

  • Challenge Board Assistant
  • Global Moderator
  • Watcher
  • ******
  • Posts: 5142
    • sdhoeys Sims & More
Re: Deleting cache files
« Reply #43 on: October 04, 2013, 09:57:52 AM »
Is there anyway to add the TMP.files to this? So that they can be deleted without deleting anything else in the DCCache folder?

Offline Niana

  • Occult
  • ****
  • Posts: 301
Re: Deleting cache files
« Reply #44 on: November 29, 2013, 02:58:49 AM »
Seconding the request for coding for the TMP files. Thanks!!

Offline Seabody

  • Global Moderator
  • Watcher
  • ******
  • Posts: 5088
Re: Deleting cache files
« Reply #45 on: November 29, 2013, 03:33:50 AM »
I don't seem to have any .tmp files in my DCCache folder, so I can't test this.

Can someone please tell me (so I can correct this if I need to), are the temp files named like this? File.tmp File2.tmp, etc? I would assume they are.

Code: [Select]
@echo off
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\CASPartCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\scriptCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\compositorCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\simCompositorCache.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCBackup\0*.package"
del "C:\Documents and Settings\My Computer\My Documents\Electronic Arts\The Sims 3\DCCache\*.tmp"
start /d "C:\Program Files\Electronic Arts\The Sims 3 Ambitions\Game\Bin" Sims3Launcher.exe

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #46 on: November 29, 2013, 07:21:32 AM »
Yes, the temp files have a .tmp extension so what you have there should work fine to delete them.
A clear conscience is usually a sign of a bad memory.

Offline sdhoey

  • Challenge Board Assistant
  • Global Moderator
  • Watcher
  • ******
  • Posts: 5142
    • sdhoeys Sims & More
Re: Deleting cache files
« Reply #47 on: July 06, 2014, 08:15:43 PM »
Thank you Seabody and grimsoul. I'm gonna update mine now and try it out. I'll let you know how it works.

Offline lahaygood

  • Llama Wrangler
  • **
  • Posts: 83
Re: Deleting cache files
« Reply #48 on: August 06, 2014, 07:15:04 PM »
I have a couple questions about the cleansims.bat file and deleting the cache files.
first, when i double click, it briefly clicks open to a black background window then it disappears.  does this mean the cache files are now deleted?

second:  can I just do a search for the cache file names listed and delete them manually?
thanks!
LA
Have a Sims kinda day! 
hugs & smiles,
Annie

Offline grimsoul

  • Watcher
  • ******
  • Posts: 1640
Re: Deleting cache files
« Reply #49 on: August 06, 2014, 08:00:44 PM »
I have a couple questions about the cleansims.bat file and deleting the cache files.
first, when i double click, it briefly clicks open to a black background window then it disappears.  does this mean the cache files are now deleted?

second:  can I just do a search for the cache file names listed and delete them manually?
thanks!
LA

The window that pops up is the batch file running. So, yes the cache files should now be deleted.

And yes you can search for the files and manually delete them if you wish.  I did it that way for awhile. I just made the batch file to automate the process instead of having to do it myself every time I wanted to delete the files.
A clear conscience is usually a sign of a bad memory.