Jump to content

defrag help


alperefe

Recommended Posts

this is my defrag batch;

for /F "eol= tokens=1 delims=( " %%i in (DrvLtr.txt) do set DrvLtr=%%i& call :dsKchk

:dsKchk
If %DrvLtr% == end goto :eof
chkdsk %DrvLtr% >resultC.log
If not errorlevel 3 goto :defrag
If not exist %DrvLtr%\windows goto :dskchkon

:dskchkoff
cd\
%DrvLtr%
echo Y chkdsk /F /R
goto :defrag

:dskchkon
chkdsk %DrvLtr% /F /R >resultOther.log

:defrag
cd\
%DrvLtr%
defrag %DrvLtr% -b >resultdefrag.log
defrag %DrvLtr% >resultdefrag.log
:EOF

ı am tryin to generate log files and info prompt for every step but especially log files overwritten everytime it is switched to a new drive; thats what ı tried;

>resultC.log

U have any suggestion?

Thank You in advance

Link to comment
Share on other sites


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...