navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Creating a Batch file to Delete Temp Internet files

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Community >> Computer Software and Hardware issues >> Creating a Batch file to Delete Temp Internet files
Page: [1]
 
JustQuestions

 

Posts: 49
Joined: 7/27/2004
Status: offline

 
Creating a Batch file to Delete Temp Internet files - 10/22/2004 14:35:29   
Does anyone know how to create a batch file that will delete temp internet files?

I have a lot of machines I need to do this on. I already have a way to delete the index.dat files, but I also need to empty the temp, history, and temporary internet files.

Can someone help, plz?

thanks,
CA
Giomanach

 

Posts: 6075
Joined: 11/19/2003
From: England
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 10/23/2004 17:52:43   
What OS are the machines on?

Either way:

Open Notepad>>enter the following:

quote:

cd\
cd C:\Documents and Settings\$username$\Local Settings\
del /Q Temporary Internet Files
echo Deleting Files
echo File Deleted
mkdir Temporary Internet Files
exit


Thats for Winows 2k, Xp and 2003, for NT, 9x, Me:

quote:

cd\
cd C:\Windows
del /Q Temporary Internet Files
echo Deleting Files
echo File Deleted
mkdir Temporary Internet Files
exit


Replace $username$ with the Account names used on the machine...

For deleting history and Temp, just change Temporary Internet Files for History or Temp.

And save the file as delete.bat or whatever you wish

Should work:)

I would try it on one machine before going any further though...I just wrote that off the top of my head

_____________________________




(in reply to JustQuestions)
JustQuestions

 

Posts: 49
Joined: 7/27/2004
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 10/25/2004 9:15:15   
Dan,

The OS is XP & 2000. After I saved the file as a bat it unfortunatly did not work. When I checked the folder the files were still there. So I tried just deleteing the files instead of deleteing the whole folder and recreating the folder. That didn't work either. The strange thing is that I can go into Temp Internet Files and delete files via explorer. So I don't understand why this isn't working. Here is what I used when deleting the files instead of the whole folder.

quote:

cd\
cd C:\Documents and Settings\kanderson\Local Settings\Temporary Internet Files\
del /Q *.*
echo Deleting Files
echo File Deleted
pause
exit


In either case I pretty impressed with quick response off the top of your head..... :) What else might you suggest?

Thanks for the help,
CA

(in reply to JustQuestions)
Giomanach

 

Posts: 6075
Joined: 11/19/2003
From: England
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 10/25/2004 9:20:08   
quote:

del /Q *.*

DOS/Command Prompt ain't that clever...it looks for a file called *.* not deletes all files...

Try this:

quote:

cd\
cd C:\Documents and Settings\$username$\Local Settings\
del /Q /F Temporary Internet Files
echo Deleting Files
echo File Deleted
mkdir Temporary Internet Files
exit


Should delete them without any prompts and forces the deletion of Read Only Files...

It may just be that a batch file is incapable of this...Could always alter the registry on the machines to ensure IE is set to empty cache on exit?

_____________________________




(in reply to JustQuestions)
dpf

 

Posts: 7121
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 10/25/2004 9:41:44   
quote:

Could always alter the registry on the machines to ensure IE is set to empty cache on exit?

no need to edit registry for that..IE has a setting under Tools/Internet Options/Advanced to delete temp files upon exit

_____________________________

Dan

(in reply to Giomanach)
Giomanach

 

Posts: 6075
Joined: 11/19/2003
From: England
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 10/25/2004 9:45:49   
True, but doing it that way means manual alteration of every single machine on the network - therefore impractical

If you edit the registry to do so, you can then export that registry key, and then use the logon script to install it on every machine every time a user logs on, or on the first time.

OK OK....I'll shut up now:)

_____________________________




(in reply to dpf)
JustQuestions

 

Posts: 49
Joined: 7/27/2004
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 11/2/2004 10:25:27   
whats the string to edit it in the registry? One more thing, I just found out that they a few group policies on deleting temp intetnet files. So I want to thank you guys for help on this issue. First they ask me to come up with a way to delete these and then they tell me that they have a GP on coping these down from the local client machines. This can be one big cluster f***:), so again thank you for the assistance.

CA

(in reply to Giomanach)
Giomanach

 

Posts: 6075
Joined: 11/19/2003
From: England
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 11/2/2004 10:37:34   
The Key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Advanced Options\CRYPTO\CACHE_PAGES

My guess is to alter the Binary string DefaultValue from 0 to 1 - I've never altered the Page caching options for IE via the registry before:)

_____________________________




(in reply to JustQuestions)
clum1

 

Posts: 758
From: Glasgow, Scotland
Status: offline

 
RE: Creating a Batch file to Delete Temp Internet files - 11/3/2004 9:18:46   
If I remember correctly, the command prompt will require non DOS file and folder names to be within inverted commas:

quote:

"C:\Documents and Settings\$username$\Local Settings\"


this should work for NT-XP machines. 9x may require you to use the DOS name format,

eg. c:\mydocu~1

cheers

Calum

_____________________________

kenilweb.com; simple, effective web design

"So I said to the Gym instructor "Can you teach me to do the splits?" He said "How flexible are you?". I said "I can't make Tuesdays"."

Tim Vine

(in reply to Giomanach)
west158

 

Posts: 1
Joined: 3/24/2007
Status: offline

 
RE: Creating a Batch file to Delete files that is on my... - 3/24/2007 12:38:52   
:) i am so struggling! could anyone tell me a line to delete a file on my computer?
here is what i would like it to say (example only)

del c:\document and settings\ MY NAME\desktop\FILE
in other words i want to delete a file on my computer and i would like to put the command line into a batch file, thankyou

:) :) :) :) :) :)

(in reply to JustQuestions)
clum1

 

Posts: 758
From: Glasgow, Scotland
Status: offline

 
RE: Creating a Batch file to Delete files that is on my... - 3/26/2007 2:40:05   
Hi West158; that command is correct but because you have spaces in the folder names, you must enclose the whole thing in double quotation marks:

del "c:\document and settings\ MY NAME\desktop\FILE.xxx"

Where .xxx is the three letter file extension (e.g. .doc. .xls, .txt etc)

Calum

_____________________________

kenilweb.com; simple, effective web design

"So I said to the Gym instructor "Can you teach me to do the splits?" He said "How flexible are you?". I said "I can't make Tuesdays"."

Tim Vine

(in reply to west158)
Kenishi

 

Posts: 1
Joined: 8/1/2007
Status: offline

 
RE: Creating a Batch file to Delete files that is on my... - 8/1/2007 23:37:26   
try this
del /Q c:\WINDOWS\Temp
cd\\
cd C:\Documents and Settings\Kenishi\Local Settings\
rmdir /S/Q Temp
echo Deleting Files
echo File Deleted
mkdir Temp
exit


First part is the normal temp dir, the second one is the one in local setting.
The del command didnt work so i tried rmdir.
Now this script will not delete files in use, so youll always be stuck with a little clutter.
The temporary internet files i have not been able to delete yet. Thinking about changing the registry key so they get saved in one of the above directories. On first sight thats the easiest solution.

Hope this helps

(in reply to clum1)
Page:   [1]

All Forums >> Community >> Computer Software and Hardware issues >> Creating a Batch file to Delete Temp Internet files
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts