Simple .Bat file by ME

Results 1 to 14 of 14
  1. #1
    Account Upgraded | Title Enabled! kip0130 is offline
    MemberRank
    Nov 2006 Join Date
    937Posts

    Simple .Bat file by ME

    its a simple 2 line bat file that cleans out the windows temporary folder where all the word backups and stuff go so it potentally over time CAN increase win 2000 and XP's speed
    its not much only 2 lines of code!
    oh yea only run this at startup if it is run at shut down things may go wrong on XP and 2000
    Attached Files Attached Files
    Last edited by kip0130; 13-04-07 at 11:44 PM.


  2. #2
    Valued Member ghell is offline
    MemberRank
    Mar 2006 Join Date
    110Posts

    Re: Simple .Bat file by ME

    this is a potentially dangerous file, and also pointless.

    Its dangerous because it removes the temporary directory, then recreates it. But what if something is using it at the time? Permission denied on the delete you would think, but what if something tries to use it at the point between its deletion and its creation?

    The safe way of cleaning temporary files is to use the "disk cleanup" tool on the drive.

    It's pointless because a) it doesn't speed anything up, it just saves disk space and b) there are better ways of doing this.

    at the very least if you want to use this you should use del /s /q %temp%/* instead of deleting the entire directory, but really you should use the methods already provided. There are probably also tools that come with windows to decrease the temporary directory's maximum size or the expiry time that files stay in there, which would be much better.

    If you are going to post a batch file, it should at least be useful. For eample the following will pull all the custom gif emoticons that are used in msn/windows live messenger etc on all messenger accounts and place them in the root msn data directory.
    Code:
    cd %appdata%\Microsoft\MSN Messenger
    findstr /S /M "GIF*" *.dat | find "CustomEmoticons">allGifs.txt
    for /F "tokens=1" %%i in (allGifs.txt) do copy /Y %%i %%i.gif
    del allGifs.txt
    This is messy because you can't use the | pipe inside the for command so it has to create a temporary file, which adds 2 lines to the batch file, but you should get the idea of what a useful and relatively powerful batch file may be.

  3. #3
    Account Upgraded | Title Enabled! kip0130 is offline
    MemberRank
    Nov 2006 Join Date
    937Posts

    Re: Simple .Bat file by ME

    ahh but if you run it ONLY at start up it isnt dangerous i forgot to add that to my post!
    it clears the directory only it dosent remove it.

  4. #4
    Omega username1 is offline
    MemberRank
    Jul 2004 Join Date
    5,867Posts

    sage

    Go clean the tempdir out yourself... don't need to waste another cluster of storage for this.

    One more thing, does it make more sense to post a 264 bytes zipped file or a 28 bytes batch file?

  5. #5
    Account Upgraded | Title Enabled! kip0130 is offline
    MemberRank
    Nov 2006 Join Date
    937Posts

    Re: sage

    Quote Originally Posted by username1 View Post
    Go clean the tempdir out yourself... don't need to waste another cluster of storage for this.

    One more thing, does it make more sense to post a 264 bytes zipped file or a 28 bytes batch file?
    the forum dosent allow uploading of .bat files only zip rar and image files

  6. #6
    Omega FragFrog is offline
    MemberRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,630Posts

    Re: Simple .Bat file by ME

    Enough with the negative comments people. Remember, constructive criticism only here!

    And yes, if I want to clean out my temp dir I usually just run windows disk cleanup, tends to be a bit more thorough

  7. #7
    All is well... Wh005h is offline
    MemberRank
    Feb 2006 Join Date
    TejasLocation
    1,984Posts

    Re: Simple .Bat file by ME

    Yah he makes some of us feel better about ourselves...
    It was a good idea but not very useful in the end

  8. #8
    Account Upgraded | Title Enabled! kip0130 is offline
    MemberRank
    Nov 2006 Join Date
    937Posts

    Re: Simple .Bat file by ME

    i guess so oh well i use it when i need a quck temp clean up and if i cant wait 5 min to diskclean up to finish

  9. #9
    Omega username1 is offline
    MemberRank
    Jul 2004 Join Date
    5,867Posts

    sage

    Quote Originally Posted by kip0130 View Post
    the forum dosent allow uploading of .bat files only zip rar and image files
    then rename it to an allowed extension? Renaming is easier than compressing (actually expanding) and then uploading amirite?

  10. #10
    Account Upgraded | Title Enabled! kip0130 is offline
    MemberRank
    Nov 2006 Join Date
    937Posts

    Re: sage

    Quote Originally Posted by username1 View Post
    then rename it to an allowed extension? Renaming is easier than compressing (actually expanding) and then uploading amirite?
    your right but theese are the allwed extensions
    bmp doc gif jpe jpeg jpg pdf png psd rar txt zip
    i guess ill put it ina txt file next time

  11. #11
    <3 alter is offline
    MemberRank
    Jul 2005 Join Date
    ArizonaLocation
    1,466Posts

    Re: sage

    Quote Originally Posted by kip0130 View Post
    your right but theese are the allwed extensions
    bmp doc gif jpe jpeg jpg pdf png psd rar txt zip
    i guess ill put it ina txt file next time
    what she means is rename the file extension such as

    bat.bat -> bat.txt

    then just rename it to batch.bat again

    pz.

  12. #12
    Omega FragFrog is offline
    MemberRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,630Posts

    Re: Simple .Bat file by ME

    Mmpf, unzipping means doubleclicking, renaming means right-clicking and entering a new extension so I prefer a zip anyway

    Though if you ask me a simple \[code\] tag would've worked

  13. #13
    Omega username1 is offline
    MemberRank
    Jul 2004 Join Date
    5,867Posts

    sage

    You mean [code][/code] tags?

  14. #14
    Omega FragFrog is offline
    MemberRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,630Posts

    Re: sage

    Quote Originally Posted by username1 View Post
    You mean [code][/code] tags?
    Yeah those.. I'm used to a different forum where you can just escape brackets like you would in a normal language :eh:



Advertisement