Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File

Status
Not open for further replies.

SRaji

IS-IT--Management
Jul 17, 2000
35
US
We are using windows 98 systems. We need to delete the files in Temp and Temporary Internet Files folder regularly. Is there anyway to do this without user intervention? i.e by just clicking on the batch file it should automatically delete all the files without asking Y/N.

Thanxs in advance
Rajalakshmi.
 
Assuming you are using MS Internet Explorer. Go to the following explorer tab.
Tools
Internet Options
Advanced

Find the following checkbox and make sure it is ticked.
Security
Empty temporary internet files folder when browser
is closed.

This should get rid of most of the garbage.
As far as I know if you try to delete all files in a directory (ie del *.*) from a batch file you will always be asked 'Y/N'. Is there someone you could get to write a tiny C++ or VB program to delete files from a specific temp directory? The program could then be called from the PCs' startup directory, or by the user from an icon.
 
You would created a new text file and rename it to delete temp.bat You would then enter the lines:

deltree /y c:\temp\*.*
deltree /y c:\windows\Temporary Internet Files\*.*


Then save the the batch file and run it. Becareful if there is a typing mistake it could damage something.
 
Hi,

Thanks AAP, Fenris for this suggestion. I tried Fenris method and created a batch file, it works fine.

Thanks again

Rajalakshmi.
dassraji@hotmail.com
 
You could put the following in the autoexec


if exists c:\temp\*.tmp del c:\temp\*.tmp
if exists c:\windows\temp\*.tmp del c:\windows\temp\*.tmp
if exists c:\windows\Temporary Internet Files\*.* del c:\windows\Temporary Internet Files\*.*






 
Paul I like the idea of testing for existance first. But wouldn't just complain if the directories were not there and continue on?
 
fenris,

It will complain abour files not being there, if the folder is empty, but it wont pause.

We use it at all our sites, to keep our software upto date on all workstations. (It makes updating a 200 user site, painless :)...

Paul
 
Hi,

Our main idea is to delete all the files from temp and temporary internet files folder without user intervention. So let me try the command in autoexec.bat with "if exists" command also.

Thanks
Rajalakshmi.
dassraji@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top