Came accross this again, found a solution through dos
http://www.ss64.com/nt/del.html
del *.* /q /f /a:H /a:S /a:A
rd <dir> /s
or better
:: Remove all files and subfolders but NOT the root folder
:: From tip 617 at JsiFAQ.com
@echo off
pushd %1
del *.* /q /f /a:H /a:S /a:A
for /f "Tokens=*" %%G in ('dir /B') do rd /s /q "%%G"
popd
This method is not preferred due to certain reasons---->
1. This is too cumbersome or "not user friendly" as it uses DOS commands which are not suitable for a normal minimal XP user (although if you are a dos lover like me, then you can certainly follow this step)
2. This still does not solves the problem which you mentioned earlier---->
I am frustrated with windows when trying to delete large amounts of temp files. Ill select all then press delete, but when it gets to one file that may be open it rightfully errors.
i.e. if the file is used by another process, even DOS's delete command ["del *.* /q /f /a:H /a:S /a:A" as you suggested] cannot delete the file.
3. I agree with Questionit on his following reply -------------->
Are you sure this command will delete folders besides files?
Why not use Windows Disk cleaner, which can delete temporary files as well- without needing to delete them manually.
Good work questionit.......I expected this from you. But I think even Windows Disk cleaner will not be able to delete files which are in use by other processes.
|||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||| |||
So is there any solution to this problem?
YES, there's certainly a solution..............
There are many of utilities online which help you perform the desired task PLUS overcome all the problems mentioned above.
Click on the link below to goto the page of a very fine utility called "UNLOCKER".
LINK
On that page you will find names of various other similar (and useful) utilities under the heading - "Similar programs and why Unlocker is better".
Now, simply download "UNLOCKER" and then install it. Then simply open the folder in which you want to delete large amounts of temporary (or any other kind) files. Press [CTRL+a] to select all the files and folders .Then right click any selected folder and select "Unlocker" option. In unlocker's window, if any locking handles for any of selected files/folders are found, then click on [UNLOCK] option and select "delete" option on the left bottom corner.
This will do your job.
__________________________________________________ ________________
NOTE ---- This utility can be useful when dealing with "deletion of viruses" as some of the virus are simply not deletable. You can virtually delete any virus using this tool.
__________________________________________________ ________________
HOPE THIS HELPS...............
==============
=AmbrNewlearner=
==============