1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Tempzap.bat or not to bat !!

Discussion in 'Other PC Software' started by Graham Newey, 2002/04/03.

Thread Status:
Not open for further replies.
  1. 2002/04/03
    Graham Newey

    Graham Newey Inactive Thread Starter

    Joined:
    2002/01/08
    Messages:
    61
    Likes Received:
    0
    Dear All,

    Hope this post is in the right section.

    A couple of months ago I created a "Tempzap.bat" file in Notepad so that I could empty my temporary folders automatically. I just copied it out without really appreciating the niceties of it. It looks as follows:-

    @ECHO OFF

    PATH=%PATH%;
    DELTREE /y C:\WINDOWS\HISTORY\*.* > NUL
    DELTREE /y C:\WINDOWS\HISTORY\HISTORY.IE5\*.* > NUL
    DELTREE /y C:\WINDOWS\HISTORY\HISTORY.IE5\INDEX.DAT\*.* > NUL

    DELTREE /y C:\WINDOWS\Tempor~1\*.* > NUL
    DELTREE /y C:\WINDOWS\TEMP\*.* > NUL
    DELTREE /y C:\WINDOWS\COOKIES\*.* > NUL
    DELTREE /y C:\WINDOWS\Applic~1\Micros~1\OFFICE\Recent\*.* > NUL
    DELTREE /y C:\WINDOWS\RECENT\*.* > NUL

    DELTREE /y C:\WINDOWS\Tempor~1\CONTENT.IE5\*.* > NUL
    DELTREE /y C:\WINDOWS\Tempor~1\CONTENT.IE5\INDEX.DAT\*.* > NUL
    DELTREE /y C:\WINDOWS\APPLOG\*.* > NUL
    DELTREE /y C:\TEMP\*.* > NUL
    DELTREE /y C:\TMP\*.* > NUL

    if exist DELTREE /y C:\WINDOWS\COOKIES\INDEX.DAT
    if exist C:\WINDOWS\Applic~1\Micros~1\Templa~1\NORMAL.DOT del C:\WINDOWS\Applic~1\Micros~1\Templa~1\NORMAL.DOT

    Echo YOUR TEMPORARY FILES HAVE BEEN CLEARED !

    (Hope this comes out OK in my post. Each command is on a single line)

    It worked OK except in respect of my "Temporary Internet Files ". Going through "Explorer" the path was "C:\WINDOWS\Temporary Internet Files ". This folder cleared fine. On the other hand going through "IE ">Tools>Internet Options etc. the path was "C:\WINDOWS\Local Settings\Temporary Internet Files ". This folder wouldn't clear !! The two paths obviously referred to the same folder.

    Someone showed me how to "move" the "IE" directory so that ALL my "TIFS" were in "C:\WINDOWS\\Temporary Internet Files" which, of course, is where they should be ! All semmed to work OK from then on.

    A couple of weeks ago, I reinstalled my Windows OS (98 SE). No major problems (and I'm recovering quite well thankyou ) BUT "Tempzap.bat" is on the blink again !!

    The two routes show the same path (no "Local Settings ") now. (Good). However, when I activate "Tempzap.bat" the "Explorer" folder (TIF) empties but now contains a folder called "Content IE5 "--- not there before --- and this contains an "Index.dat" file 336 KB in size. The "IE" folder (TIF) DOES NOT empty (remains untouched). Further a few minutes later when I go back to the "Explorer" folder all the files that had emptied HAVE RETURNED !!!!

    Can some clever person tell me why what is happening is happening and how I can get all my "TIF's" to go away and stay away when I ask them to ??

    NB1: If I examine "IE" TIF folder FIRST I find it unaltered (as before). If I then go to "Explorer" TIF, guess what ? It HASN'T emptied !!

    NB2: The "Index.dat" file is ALWAYS 336KB in size. I can't open it. What is likely to be in there and why is it ALWAYS 336 KB ?

    Many thanks for your time. Graham
     
  2. 2002/04/03
    Zephyr

    Zephyr Inactive

    Joined:
    2002/01/21
    Messages:
    1,519
    Likes Received:
    0
    Hi Graham Newey

    Your post is concise and informative but I will need a couple more pieces of info before I can help you.

    First, do you run this batch in native DOS or are you running it in the Windows environment?

    Secondly, what is the version of your browser and did you upgrade recently?

    Post back and we'll see what gives.
     

  3. to hide this advert.

  4. 2002/04/04
    Graham Newey

    Graham Newey Inactive Thread Starter

    Joined:
    2002/01/08
    Messages:
    61
    Likes Received:
    0
    Tempzap.bat or not to bat !!!

    Dear Zephyr,

    Thanks for taking the time to respond to my question.

    I created "Tempzap.bat" within the Windows environment using "Notepad" and manufactured a "Desktop Shortcut ". I activate it by double clicking said "Desktop Shortcut "--- in Windows of course.

    When I reinstalled Windows my browser was "Internet Explorer" v 5.0. I have since upgraded/updated it to v 6.0.

    Look forward to hearing from you again.

    Regards. Graham
     
  5. 2002/04/04
    Zephyr

    Zephyr Inactive

    Joined:
    2002/01/21
    Messages:
    1,519
    Likes Received:
    0
    OK, let's proceed...

    Greeting Graham,

    Before we do anything desperate I want you to run that batch file in a native DOS mode. Here's why; when in the Windows environment, the pesky index.dat file is actively being used and cannot be accessed by your script. There are actually several of those index.dat files that relate to cookies and temp files. Further, to answer another of your questions, the index.dat file is a "Cache" type file and its size does not change in direct proportion to its presumed contents. It will increase its size when it sees the need but you have not witnesses that since you evidently haven't pushed it to its limit. It actually concatenates the files it contains so as to conserve disk space but some would say in order to secret them. The latter is somewhat true.

    Post back your results after running the batch in DOS and checking as to its performance from that exercise. Look at all the usual places that you are familiar with and see if they are cleared. Also verify that the path to the TIF's is indeed C:\Windows\Temporary Internet Files and that no C:\Windows\Local Settings directory exists. If it does, right click the IE icon on the Desktop and choose Properties and look to see the path of the TIF and verify it's C:\Windows\Temporary Internet Files. Then go back and delete the Local Settings directory.

    Forgive me for asking for things you have no doubt covered already but I need to be thorough and sure about all.

    I await your results. Local time (California presently) is 3:30 pm so I'll be here for a while.
     
    Last edited: 2002/04/04
  6. 2002/04/05
    Graham Newey

    Graham Newey Inactive Thread Starter

    Joined:
    2002/01/08
    Messages:
    61
    Likes Received:
    0
    Tempzap.bat or not to bat !!!

    Dear Zephyr,

    Many thanks for your last post.

    I started computer and then restarted in "MS-DOS Mode "(OK?). Typed "Run Tempzap.bat ". Hit Enter. Message--- "Bad command or file name ". Typed "Start Tempzap.bat ". Hit Enter. Message--- "This program cannot be run in DOS mode ".

    Verified path to TIF's is ONLY "C:\Windows\Temporary Internet Files ". No "Local Settings" directory.

    Had a brainwave and looked in "Windows Help ". Went to "MS-DOS Troubleshooting ". Read about configuring an "MS-DOS" based (?) program to run in" MS-DOS Mode. "

    Right clicked program icon (not shortcut)>Properties>Program>Advanced>selected "MS-DOS mode" check box>OK>OK.

    Ran program by double clicking program icon. "MS-DOS" screen appeared. After some time "Your temporary files have been cleared " message appeared.

    Checked all relevant folders . ALL clear. "BOTH" TIF folders were clear ! They STAYED clear ! Content IE5 and Index.dat DON'T appear in the TIF folder. However found an Index.dat file in "C:\Windows\Recent "--- 361 KB.

    Have I cracked it ?? (If so, more by luck than judgement !)

    Two things. When I try to activate "Tempzap.bat " now via my "Windows Desktop" shortcut icon I get my "Finished Tempzap" window as before but it doesn't appear to have worked. Certainly NEITHER of my TIF folders has emptied ! How can I create an effective Desktop shortcut which will effectively activate my newly configured "Temzap.bat file "? Secondly, (and nothing to do with what we've been talking about )at top of my "MS-DOS" screen is the statement "Locate free PCI Resources for Creative Audio card..... ". Any idea what this is about ? Have I got a problem ?

    Would appreciate your further comments. Thanks again.

    Regards. Graham
     
  7. 2002/04/05
    BillyBob Lifetime Subscription

    BillyBob Inactive

    Joined:
    2002/01/07
    Messages:
    6,048
    Likes Received:
    0
    Graham Newey

    Tempzap.bat ". Hit Enter. Message--- "This program cannot be run in DOS mode ".

    I believe that message is correct.

    Your project may not run in the MSDOS MODE. Because in the DOS Mode part of Windows is still running. And the project needs Clean DOS.

    In order to make your project work properly you will need to either Boot into the Command Prompt Only at boot up or boot to a Windows Startup Disk.

    Or you could put a CALL to the batch file CALL C:\[ folder containing the file ]\xyz.bat into the Autoexec.bat and then it would work also. As it would be executed before Windows starts.

    And if you do run it from the Autoexec, just double check that the C:\Windows\temp folder is still there. It is the only one that will not get rebuilt when Windows or IE as started.

    It looks like you are safe but check to make sure.

    at top of my "MS-DOS" screen is the statement "Locate free PCI Resources for Creative Audio card..... ". Any idea what this is about ? Have I got a problem ?

    That is probabley in the DOSSTART.BAT and refers to your Audio card of course.

    Problems ? I do not think so. Unless you are using any DOS software that requires it. And the audio does not work in DOS. I have not seen Creative mess up for DOS settings yet.

    BillyBob
     
    Last edited: 2002/04/05
  8. 2002/04/05
    Zephyr

    Zephyr Inactive

    Joined:
    2002/01/21
    Messages:
    1,519
    Likes Received:
    0
    Hi Graham,

    For clarity I will paste a copy of your post and respond after each section.

    I started computer and then restarted in "MS-DOS Mode "(OK?). Typed "Run Tempzap.bat ". Hit Enter. Message--- "Bad command or file name ". Typed "Start Tempzap.bat ". Hit Enter. Message--- "This program cannot be run in DOS mode ".

    +++++++++++++++++++++++++++++++++++++
    You were not typing the proper command line. Before I can tell you the correct line, I will have to know where the Tempzap.bat file is located but I will give you a couple of examples and you can extrapolate. When running a file from the DOS command line it is best to be resident in the same directory that the file exists in so as to eliminate any Path Statement problem. If the file is on you C:\ (root) the command would be:

    tempzap.bat (nothing more, no RUN, no START) and press enter

    If it is in the Windows directory then you will need more commands to bring you to the resident directory:

    cd\
    cd Windows
    tempzap.bat

    Pressing enter after each line.
    Try running the file using this method and you'll find that it will work as best it can (more about that later).
    +++++++++++++++++++++++++++++++++++++++++++++

    Verified path to TIF's is ONLY "C:\Windows\Temporary Internet Files ". No "Local Settings" directory.
    ++++++++That's good. Check that occasionally, I have had some software installs that move that directory and added the Local Settings folder.+++++++++

    Had a brainwave and looked in "Windows Help ". Went to "MS-DOS Troubleshooting ". Read about configuring an "MS-DOS" based (?) program to run in" MS-DOS Mode."

    Right clicked program icon (not shortcut)>Properties>Program>Advanced>selected "MS-DOS mode" check box>OK>OK.

    Ran program by double clicking program icon. "MS-DOS" screen appeared. After some time "Your temporary files have been cleared " message appeared.

    Checked all relevant folders . ALL clear. "BOTH" TIF folders were clear ! They STAYED clear ! Content IE5 and Index.dat DON'T appear in the TIF folder. However found an Index.dat file in "C:\Windows\Recent "--- 361 KB.

    Have I cracked it ?? (If so, more by luck than judgement !)

    +++++++++That's one way of exiting Windows to DOS but it's not as easy/clean as doing it by rebooting from scratch and going through the menu method.

    Your method will work, as you have seen. It did accomplish the purpose I intended and that was to show you that running the script in a NATIVE DOS session (that mean after exiting Windows) would make it work as well as possible.

    If you want to use the method you have discovered, you will need to go to the directory where you have the file located and find the shortcut that will be there (has a MsDos icon and a small arrow indicating a shortcut) with the name TEMPZAP and drag (or Cut and Paste) it to your Desktop. Then delete the old shortcut you previously had. Always leave the Program configured for running in DOS as you now have it set.

    You can use that or else run it by going through the boot up menu and booting to dos as mentioned earlier. Either way is good.

    It's also possible to change the properties of your existing shortcut and use it instead of moving the other . You can even create a new shortcut and configure it to do this. All methods will work so play around with it and learn something for later use maybe.

    ++++++++++++++++++++++++++++++++++++++



    Two things. When I try to activate "Tempzap.bat " now via my "Windows Desktop" shortcut icon I get my "Finished Tempzap" window as before but it doesn't appear to have worked. Certainly NEITHER of my TIF folders has emptied ! How can I create an effective Desktop shortcut which will effectively activate my newly configured "Temzap.bat file "?
    +++++++++++++++++++++++++

    For the reasons previously mentioned, the Properties of this shortcut are not set to run the prigram in DOS.

    +++++++++++++++++++++++++++++++++
    Secondly, (and nothing to do with what we've been talking about )at top of my "MS-DOS" screen is the statement "Locate free PCI Resources for Creative Audio card..... ". Any idea what this is about ? Have I got a problem ?
    ++++++++++++++++++++++++++++++++++++

    The sound card reference indicates that the present configuration of DOS under Windows (and also as being loaded when you exit by your method) is attempting to load the sound card drivers. Pay no heed to that since it will cause no harm. If you run the file from the boot up command line, you won't get that message.

    OK, let's plow some new ground now.

    I think this will get you going but I must end with a comment and a link to a program that you should consider getting. It's freeware.

    The fact is, you are not deleting all of the index.dat files and you can't easily do that without some other method. To leave any of them runs the risk of having all the files you delete with your batch be regurgitated upon next boot.

    The Help file of the program I am linking will explain all that and more. Read it and consider using the program. Just in case you decide to get and use it I'll save you some time getting up to speed with it.

    When you download and unzip it to a directory, it creates three or four files; one is the main program called SPIDER.EXE, another is the HELP file, and lastly SPIDERBITE.EXE which is an adjunct to the main program, You do not ever need to click the SPIDERBITE.EXE file, always use the SPIDER.EXE file to run the program or a shortcut to it.

    You can place the folder and its file anywhere you like on your drive. The program is free standing and writes no program files to your system directory.

    If and when you run Spider, start by clicking SPIDER.EXE (or shortcut) and when it opens click the magnifying glass icon at the toolbar, when it finished scanning click the icon that looks like an ambulance, the select Continue from the next screen. When you get the screen with all the options boxes, tag every one of them and click finish. Reboot and the tagged files will be cleared but more importantly, all hidden index.dat files will also be cleared, regardless of where they are hiding.


    SPIDER is a very handy little utility and I recommend getting it while the link is still active. I'm not sure how it works above Windows 98 but it works well in 95 and 98.

    Post back as to your progress and any other comments. I have probably kept you up late reading this but perhaps it's worth the while.

    Best regards
     
    Last edited: 2002/04/05
  9. 2002/04/07
    Graham Newey

    Graham Newey Inactive Thread Starter

    Joined:
    2002/01/08
    Messages:
    61
    Likes Received:
    0
    Tempzap.bat or not to bat !!!

    Dear Zephyr and Billy Bob,

    Thank you both for your responses. Thank you Zephyr for all the time you’ve taken with me.


    To ZEPHYR
    (1) The path to Tempzap.bat is "C:\Tempzap.batâ€. Restarted in DOS. Typed Tempzap.bat at the prompt--- message---“Bad command or file nameâ€. Typed "cd\" at the prompt. "Windows" disappears. Typed "Tempzap.bat" at new prompt. After several seconds seemed to work fine. Certainly both my TIF folders had emptied and stayed empty.
    (2) Think I’m going to stick with my "brainwaveâ€. I worked out how to create a new shortcut that worked about 3 seconds after sending my last post!
    (3) Noted your comments re Index.dat files and your link to SPIDER.EXE. What a clever young Dutchman! I’ve downloaded it and followed your instructions. I don’t fully understand it all but it seems to work fine with my "IE 6â€. Did you know about this Billy Bob? Have a look at it.
    (4) I’ve created a Desktop shortcut for "SPIDER" and placed it next to my new "Tempzap" shortcut. The two together really seem to fit the bill. Obviously there is some overlapping of their separate functions, but presumably I can reduce that to a minimum with some intelligent (careful!) editing of my "Tempzap" file?


    To BillyBob (my spell checker suggests I change this to "Bullyboy" !!!)
    (1) “Boot into the Command Prompt Only at boot upâ€. How do I do that please?
    (2) Thanks for the tip about putting a CALL into Autoexec.bat. Bearing in mind the path of my "Tempzap" file (see above) could you confirm the correct syntax of the command that I would need to use? Would it be simply "CALL C:\Tempzap.bat�


    Thanks again gentlemen.

    Regards. Graham
     
  10. 2002/04/07
    Zephyr

    Zephyr Inactive

    Joined:
    2002/01/21
    Messages:
    1,519
    Likes Received:
    0
    Hi again,

    I'm glad you have a handle on things now Graham and as you mentioned, you have some overlap now but that's not a bad thing.

    Let me caution you against calling the tempzap.bat you have in the Autoexec.bat. The problem will be that if you ever install some software that requires a reboot to finish loading, your batch script may erase the files it is depending on for completion of the install. Many times they will be in the Temp folder.

    To answer your other question, yes, the command would be CALL C:\TEMPZAP.BAT if you were to use it.

    The trouble you had before was that you were not resident in the root directory when you issued the tempzap.bat command. When not resident in the same directory that contains the file you would need to give the full path in the command. If your prompt says C:\Windows> then to run the batch from there type C:\tempzap.bat and it will run. Merely typing tempzap.bat won't run it since you're in the Windows directory and it doesn't exist there.

    All turned out fine so that's to be enjoyed. If you follow some of the other posts here, one makes reference to "If it works, fix it until it doesn't" :) Let's not do that here. :D

    Best regards

    ps, As a final piece of advice, you should add the smartdrv.exe command line between the @ECHO OFF and the line that follows.

    The second line would be then be,

    smartdrv.exe

    Initializing Smart Drive Caching will make the batch file commands run much faster. Deleting TIF's can take several minutes without Smart Drive. (smartdrv.exe) and mere seconds with it.
     
    Last edited: 2002/04/07
  11. 2002/04/07
    BillyBob Lifetime Subscription

    BillyBob Inactive

    Joined:
    2002/01/07
    Messages:
    6,048
    Likes Received:
    0
    The path to Tempzap.bat is "C:\Tempzap.batâ€. Restarted in DOS. Typed Tempzap.bat at the prompt--- message---“Bad command or file nameâ€.

    If the above gave you that error message then the root folder C:\ is not in the path statement of the Autoexec.bat.

    If you typed C:\Tempzap.bat and it worked this would prove my theory.

    If you wish to edit the Autoexec.bat you can type SYSEDIT in the Start/Run line.

    UNLESS you are running ME you can actually just type C:\TEMPZAP.BAT in the Start/run line. It should take care of itself right from there. It should switch itself into the proper DOS, do its job and restart you back into Windows. If all things are correct there is no need to switch to DOS to run DOS commands.

    If the files is catually in the root folder ( C:\ ) then you can add the command line to the autoexec.bat

    CALL C:\TEMPZAP.BAT

    C:\ Being the path to and tempzap being the file to call.

    I have not seen ( that I recall anyway ) any mention as to which version of Windows you are running. But, if you happen to be using ME then this will not work from the Autoexec.bat cause ME does not allow it.

    The idea is fine. But if ANYTHING goes wrong during the switch over from Windows to DOS and back all kinds of NASTY things can happen. ( been there, done that and it is NOT NICE ) Because when you switch into the MsDOS mode ( not the DOS PROMPT ) it is ( under certain conditions ) doing a DUAL BOOT.

    That is why I prefer to see a program of the type in question run from either the Command Prompt at boot up or after a boot to the Windows Startup Disk. Or from the Autoexec.bat. Those three choices do not involve Windows at all.

    Holding down the Control Key while booting should get you a menu with several choices. Command prompt being one.IF YOU DO NOT HAVE ME

    BillyBob
     
    Last edited: 2002/04/08
  12. 2002/04/07
    BillyBob Lifetime Subscription

    BillyBob Inactive

    Joined:
    2002/01/07
    Messages:
    6,048
    Likes Received:
    0

    Absolutely 100% correct and I 100% AGREE. VERY Good catch Zephyr

    And along with that I will added a little bit.

    Also with the folders that you have setup ( I beleive I see Office ) If you have to restart there is a possiblitiy of erasing some of those files at the wrong time.

    BE careful when you run the Tempzap as it will do the same thing when run from anywhere.

    Make sure that any software is installed completely and correctly BEFORE use the Tempzap.

    The whole Idea is fine. But as we all know DOS is a powerful tool but can also be dangerous as it is NOT FORGIVING at all. Anything DOS does it not recoverable.

    My final word of caution DO NOT put it in the Autoexec.bat

    BillyBob
     
  13. 2002/04/08
    Graham Newey

    Graham Newey Inactive Thread Starter

    Joined:
    2002/01/08
    Messages:
    61
    Likes Received:
    0
    Tempzap.bat or not to bat !!!

    OK BillyBob. Thanks for your last comments.

    I think I'm "with it" now.

    Much obliged. Graham
     
  14. 2002/04/08
    BillyBob Lifetime Subscription

    BillyBob Inactive

    Joined:
    2002/01/07
    Messages:
    6,048
    Likes Received:
    0
    You are welcome.

    But the thanks really go to Zephyr He is the one who shook up this old guys memory.

    From my own experience I should have known better than to even suggest putting that type of program in the Autoexec.

    I was so into helping you get the thing to work that I was not even thinking about the dangers of it.

    BillyBob
     
    Last edited: 2002/04/08
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.