Posted: Fri Jul 29, 2005 10:43 am Post subject: Deleting Cache, X, Y, Z script question.
Hi everyone. Does anyone have any guidance on how I could write a script that could be called from the menu that will delete both cache files and clear out the contents of drive X, Y & Z?
I find that on occasion I need to do so to regain sanity and it would be great if I could do it in a more automated way... yeah yeah I know it only takes a few seconds but think of all the time I could regain in a lifetime using a script! (oh... yeah I suppose it will all be wasted in writing this question and reading the responses and writing the script - none-the-less!). :)
boing!
funkydopeloven Xbox-Hq Genius
Joined: Nov 30, 2004 Posts: 1942
Posted: Fri Jul 29, 2005 11:19 am Post subject:
pop AID in drive, format cache drives
boing Xbox-HQ Enthusiast
Joined: Jun 12, 2005 Posts: 46
Posted: Fri Jul 29, 2005 3:54 pm Post subject:
Yeah... I know... Can I move that script to my HD so I don't have to pop anything anywhere?
boing!
pirrup V.I.P. Lifetime
Joined: Feb 01, 2005 Posts: 1345 Location: belgium
Posted: Fri Jul 29, 2005 4:11 pm Post subject:
yea if you put it in config.xml in unleashx _________________
ahhh... so if I look at the config.xml on the cd will all the answers become clear! :)
boing!
boing Xbox-HQ Enthusiast
Joined: Jun 12, 2005 Posts: 46
Posted: Fri Jul 29, 2005 4:40 pm Post subject:
Before I blow things up: :)
does this look right:
<List Text="Clear cache and XYZ" Sort="Off" Batch="True">
<Item Action="AskUser" Arg1="notice">This option will delete all the files from E:\CACHE as well as the contents of X, Y and Z drives. Are you sure you want to do this?</Item>
<Item Action="Delete" Arg1="E:\CACHE\*"></Item>
<Item Action="Delete" Arg1="X:\"></Item>
<Item Action="Delete" Arg1="Y:\"></Item>
<Item Action="Delete" Arg1="Z:\"></Item>
</List>
I'm a little concerned about the E:\CACHE\* part... does that look right?
Thanks for the help!
boing!
EDIT: Yeah - this doesn't quite work... It doesn't like something to do with Delete... it choked on the * but without it it deletes the CACHE directory (which isn't right either). :) still working on it.. I'll update when I get it working.
boing Xbox-HQ Enthusiast
Joined: Jun 12, 2005 Posts: 46
Posted: Fri Jul 29, 2005 6:08 pm Post subject:
ok a couple of things...
1) Format cache drives doesn't actually clear the cache. It just just formats X Y Z. E:/CACHE is not touched.
2) The little code above does fine (well without the *) to get rid of the contents of XYZ and E:/CACHE. Unfortunately it also removes E:/CACHE.
Any thoughts on how to delete the contents of E:/CACHE without removing the actual directory (in other words leaving the directory empty).
* and *.* don't help... I've tried.
boing!
pirrup V.I.P. Lifetime
Joined: Feb 01, 2005 Posts: 1345 Location: belgium
Posted: Fri Jul 29, 2005 6:47 pm Post subject:
<List Text="Clean Cache" Sort="Off" Batch="True">
<item action="messagebox" arg1="Clean Cache">This will clear your cache. This can help if many games don't start or hang.</item>
<Item Action="delete" Arg1="e:\cache"></Item>
<Item Action="Format" Arg1="X" ></Item>
<Item Action="Format" Arg1="Y" ></Item>
<Item Action="Format" Arg1="Z" ></Item>
<item action="messagebox" arg1="Done">Cache is cleaned.</item>
</List> _________________
Pirrup - that does that same thing I had mentioned earlier - it removes the cache directory. I just want to empty the cache directory? Is the difference clear enough?
I've found that I can delete the two files individually like this:
<List Text="Clear cache and XYZ" Sort="Off" Batch="True">
<Item Action="AskUser" Arg1="notice">This option will delete all the files from E:\CACHE as well as the contents of X, Y and Z drives. Are you sure you want to do this?</Item>
<Item Action="Delete" Arg1="E:\CACHE\LocalCache00.bin"></Item>
<Item Action="Delete" Arg1="E:\CACHE\LocalCache08.bin"></Item>
<Item Action="Delete" Arg1="X:\"></Item>
<Item Action="Delete" Arg1="Y:\"></Item>
<Item Action="Delete" Arg1="Z:\"></Item>
</List>
but if they aren't there is errors as well (which is not elegant but then again if they aren't there why am I trying to delete them?) . I could put the delete x y and z first so that they all get cleared out and then it will either error or not depending on if there is something to delete in cache. However it would be best to just delete the contents of cache or remove cache and then mkdir it back but I can't make that work either. ;)
Are there and docs on unleashx? I can't find any reference to this stuff anywhere. :)
boing!
pirrup V.I.P. Lifetime
Joined: Feb 01, 2005 Posts: 1345 Location: belgium
Ok your script does the same thing mine does and does not recreate the cache directory.
I'm not sure of the difference between format and delete in this context but they both appear to do the same thing.
On to the question of the moment. How do I write a script that either just clears the contents of e:\cache but leaves e:\cache in place OR how do I mkdir it back once it is gone from the action delete that we are both using.
boing!
pirrup V.I.P. Lifetime
Joined: Feb 01, 2005 Posts: 1345 Location: belgium
Posted: Fri Jul 29, 2005 7:49 pm Post subject:
i'm gonna say this one more time and this is the last time,
when my script deletes it its gone
but when a game puts files in cache it will create the CACHE dir
look up what delete is and format is on a pc , xbox = pc
format is used for drives not for directory or files ( X Y Z are drives not dirs)
delete is used for removing files and directories _________________
ok - but this is the 'first' time you said a game would put it back.
last time you said:
"use my script m8
thats the one that is correct
it will create CACHE again."
I guess by 'it' you meant a game.
As to the format vs. delete issue they both accomplish the same result - X Y and Z end up empty. Format will definitely clear things out but delete will do the same thing (except that it's might perhaps miss hidden or system files I suppose).
Anyway - I should probably drop the issue but since it's been academic for the last few messages anyway I'll ask my question again very clearly since I'm just trying to learn something and have a 'perfect script' that won't create errors (like yours and mine) - try running your script two times in a row and you'll see what I mean.
QUESTION: How do I delete the contents of a directory without deleting the directory itself - OR - how do a create an empty directory. Either of those should get me to the 'perfect script nirvana (tm)' I'm trying to find.
boing!
pirrup V.I.P. Lifetime
Joined: Feb 01, 2005 Posts: 1345 Location: belgium
Posted: Fri Jul 29, 2005 8:05 pm Post subject:
MY SCRIPT DOESN'T GIVE ERRORS!!!
why would you do a clear cache 2 times after eachoter????
about your question:
you can't man i would tell you how if it was possible
if you didn't know i'm a softmod admin here _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum