Jump to content

Recommended Posts

Posted

@ mazin

Just an addition or change to your information:

if you use

DEL/F/A/S/Q

you will not need to use

ATTRIB

because the /A switch used blindly will take care of all attributes!


Posted
@ mazin

Just an addition or change to your information:

if you use

DEL/F/A/S/Q

you will not need to use

ATTRIB

because the /A switch used blindly will take care of all attributes!

Actually, I used attrib -r -a -s -h with /S to remove attributes from files in the main directory and subdirectories.

attrib -r -a -s -h  /S /D "%TEMP%"

I added /D to remove attributes from subdirectories, as well. This will make it be easy for rd /S /Q "%TEMP%\" to delete all subdirectories without leaving some ones behind.

It could be good if /A (your idea) is functioning the same with directories. I mean something like this: rd /A /S /Q "%TEMP%\"

If it could be, then three lines of code can be shrinked to one. My TEMP is now clean; so I can't test it, however.

Thanks for the tip anyway.

Posted (edited)

This batch file code will remove all files and directories which are not in use from the users temp files location.

FOR /F "DELIMS=" %%? IN ('DIR/B/AD %TEMP%\*') DO RD/S/Q "%%~f?"
DEL/F/A/Q %TEMP%\*.*

Like I said, system files and directories, hidden files and directories and read only files and directories are taken into account.

<Edit>

Oh and BTW

rd /S /Q "%TEMP%\"
will not preserve the Temp directory, it will remove it too.

</Edit>

Edited by Yzöwl
Posted

So much work for such a small return! :no:

All you need to get a thorough HD cleanup on every boot is my XPCleanup.bat program.

It uses the Deltree.exe program found on any windows 98, 98/SE or ME computer.

It's also on My Webpage

Every temp folder or cache folder on the HD is emptied in just a few seconds.

The batch file or a shortcut to it can be placed in the Startup folder for free maid service every time you boot up your PC. A clean PC is a Happy PC. :yes:

Then run "Disk Cleanup" and "Defrag" once a week for a really Happy PC. :thumbup

Since its a simple DOS batch file, lines can be added or removed to suit your personal needs and desires.

Both the batch file and Deltree.exe are contained in my "Care Package" found on my Download Site, Here.

I've even included an Install program for it.

In the Care Package, read the Instruction file before running any of the programs.

Happy Computing!

Andromeda43

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...