TechSpot

BATCH, to delete and save one log

?

BATCH, to delete and save one log.

  1. batch logs of the files deleted

    0 vote(s)
    0.0%
  2. batch with the size of the removed files

    0 vote(s)
    0.0%
By CeesarSol
Oct 1, 2014
Post New Reply
  1. Hi All,

    I am trying to do one batch to delete all the temporary files in the machine and save one log of the space removed and/or the removed files.

    Now I have the steps to remove the temporal files


    ==
    @Echo off

    IF EXIST c:\windows\temp\ del /f /s /q c:\windows\temp\
    IF EXIST c:\windows\tmp\ del /f /s /q c:\windows\tmp\
    IF EXIST C:\tmp del /f /q C:\tmp\*.*
    IF EXIST C:\temp del /f /q C:\temp\*.*
    DEL /f /s /q %temp%\
    DEL /f /s /q %tmp%\

    IF EXIST "C:\Users\" (
    for /D %%x in ("C:\Users\*") do (
    rmdir /s /q "%%x\AppData\Local\Temp"
    mkdir "%%x\AppData\Local\Temp"
    )
    )

    IF EXIST "C:\Users\" (
    for /D %%x in ("C:\Users\*") do (
    rmdir /s /q "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files"
    mkdir "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files"
    )
    )
    @Echo off
    ==

    any one could help me in how I could save the log ?
     

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...