Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm probabbly one of the least skilled people at writing batch files but I have been practicing making a maintenance batch file for our XP machines at work (all 495 of them) in which I don't have the time to set them up in scheduler normally so I'm using a batch file and an altiris deployment method to set these up. Now, I should have done it before but I did not set up the profiles to delete the temporary internet files while leaving internet explorer. It does clean some, but leaves plenty of cookies/images behind still after even after running cleanmgr.exe .
So heres my problem in writing the batch script:
Alot of the time people are switching to different computers at different locations. This creates a profile and creates the files they use under the documents and settings folder on the C:. I am curerntly stuck at this point in my attempts to clear it:
DEL C:\Documents and Settings\%USERPROFILE%\Local Settings\Temporary Internet Filse\*.* /Q /F
However this only cleans it locally for that particular user when the scheduler runs. I do not want this to happen necessarily daily, but more like monthly just to clear up any excess. If there are 10 different users on that machine and some have not even been accessed for 10 days, how can I have it go into each user folder in the documents and settings and delete the path shown above?
One more quick question- can a vbs script be run through a batch file and wait for the vbs script to finish before continuing with the rest of the script?

Try this for the bat:
:: TIFclean.bat
@echo off:main
pushd "C:\Documents and Settings
for /f "tokens=* delims=" %%U in ('dir /ad /b') do call :deleter %%U
popd
goto :eof:deleter
del "%*\Local Settings\Temporary Internet Files" /F /Q
:: DONE
If at first you don't succeed, you're about average.M2

This works great except for one problem- does not accept anything with a username that comes from a domain: usernamehere.domainnamehere - any way around that?

Is the directory:
usernamehere.domainnamehere
actually there?
If at first you don't succeed, you're about average.M2

yes, its one of the folders there and common among several users. for example, akl.mfcu is there and its temporary internet files folder is not being emptied.

So you have:
C:\Documents and Settings\usernamehere.domainnamehere\akl.mfcu\Local Settings\Temporary Internet Files
Is that correct?
If at first you don't succeed, you're about average.M2

No, what I mean is I have:
C:\Documents and Settings\akl.mfcu\Local Settings\Temporary Internet FilesAnd while it deletes the internet files from say:
C:\Documents and Settings\akl\Local Settings\Temporary Internet FilesIt does not do it from the domain username as show above. Any thoughts?

I just created this:
C:\Documents and Settings\akl.mfcu\Local Settings\Temporary Internet Files
put some files, ran the bat and they got deleted.Dunno what's wrong.
Do this and post what you get:
cd "C:\Documents and Settings
dir /ad/b
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |