Windows Temp files.

What extension(s) do I need to add to:

echo | del c:\windows\temp\*.*

to delete  hidden files in the windows temp folder.  This is ran as a batch file and cleans out temp files when a users logs on.








pbut835581Asked:
Who is Participating?
 
israelyConnect With a Mentor Commented:
add this line before the line you have listed:

attrib c:\windows\temp\*.* -h

I have never seen hidden files in temp directory.
0
 
israelyCommented:
Type:

attrib /?

to see all the switches avaiable at the dos prompt.
0
 
m_santoCommented:
The *.* will make it delete all files with all extensions in the folder, already.

It will not, however, delete any subfolders.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
m_santoCommented:
m_santo changed the proposed answer to a comment
0
 
m_santoCommented:
Whoops, I misread the question.  Missed the part about hidden files.  Sorry.
0
 
m_santoCommented:
Whoops, I misread the question.  Missed the part about hidden files.  Sorry.
0
 
red117Commented:
Why dont you just try deltree c:\windows\temp and delete the whole temp directory, when it tries to write to it again it will remake the directory.
0
 
AjninCommented:
red117 idea is good, but to make not prompt the user, try the following syntax:
echo. Y|deltree c:\windows\temp
0
 
pbut835581Author Commented:
Thank you very much.  
0
All Courses

From novice to tech pro — start learning today.