PDA

View Full Version : Auto Cache cleaner on TSM start. Windows only


Deylendor
5th Mar 2012, 12:18 AM
For those who want to clear up your cache files automaticaly upon TSM start.
Open up any text editor and paste this code into it.


regMyDoc ="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal"
regTSMexe ="HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\The Sims Medieval\GameEXE"
set fso = CreateObject("Scripting.FileSystemObject")
set wshShell = CreateObject("WScript.Shell")
pathTSM = wshShell.RegRead(regTSMexe)
pathMyDoc = wshShell.RegRead(regMyDoc)
File1 ="\Electronic Arts\The Sims Medieval\CASPartCache.package"
File1 = pathMyDoc+File1
File2 ="\Electronic Arts\The Sims Medieval\compositorCache.package"
File2 = pathMyDoc+File2
File3 ="\Electronic Arts\The Sims Medieval\simCompositorCache.package"
File3 = pathMyDoc+File3

if fso.FileExists(File1) then
fso.DeleteFile File1, True
end if
if fso.FileExists(File2) then
fso.DeleteFile File2, True
end if
if fso.FileExists(File3) then
fso.DeleteFile File3, True
end if
pathTSM = """"+pathTSM+""""
wshShell.run pathTSM,6,False

Set wshShell = nothing
Set fso = nothing


Save it under any name with the VBS extension. And run it, voila!
It checks your registry to find your My Documents folder to find to cache files and deletes them if any of them exists and runs your Sims Medeival from wherever your game is installed (reads your registry for TSM.exe location).

cheers.