1.

Solve : Combine Check Disk and Defrag into one Bat file, and get no error messages?

Answer»

I've been getting these error MESSAGES, using Scheduled Tasks to do Check Disk and Defrag on my two HARD drives:

5/18/10 it did not Defrag C:, got exit code of 0x6

9/21/10 It did not Check Disk D:, cannot lock current drive, volume dismounted, all opened handles to this volume are now invalid

I think I just need to disable some services, then it will work.  Everything I've figured out is here, I think I'm close:

http://www.codeproject.com/Questions/117564/DOS-commmands-to-disable-re-enable-non-MS-Services.aspx?display=Print

This is what I have that needs to be modified somehow.  The code just flashes on the screen.  Thank you for your input.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

sc config avg9wd start= disabled
sc config CTAudSvcService start= disabled
sc config nvsvc start= disabled

ECHO y|CHKDSK D: /X/R
ECHO y|CHKDSK C: /R

C:\WINDOWS\system32\defrag.exe d: -v>"c:\Documents and Settings\Administrator\Desktop\defrag d.txt"
C:\WINDOWS\system32\defrag.exe c: -v>"c:\Documents and Settings\Administrator\Desktop\defrag c.txt"

sc config avg9wd start= auto
sc config CTAudSvcService start= auto
sc config nvsvc start= auto

SHUTDOWN -rI PUT my conclusion here at the bottom of this page.

http://www.codeproject.com/Questions/117564/DOS-commmands-to-disable-re-enable-non-MS-Services.aspx

It does not appear to me that a DOS command can disable some Services

******************************************************************

Control Panel \ Network Connections \ [right-click] Local Area Connection 5 \ Disable

Start \ Run \ msconfig \
Services tab \ [check] Hide All Microsoft Services \ Disable All \ Apply
Startup tab \ Disable All \ Apply
Close \ Restart

Then let Scheduled Tasks run the following bat file at 1:00 AM, on the third Tuesday of every month, view the RESULTS in the AM.

--------------------------------------------------------

C:\WINDOWS\system32\defrag.exe c: -v>"c:\Documents and Settings\Administrator\Desktop\defrag c.txt"
C:\WINDOWS\system32\defrag.exe d: -v>"c:\Documents and Settings\Administrator\Desktop\defrag d.txt"

ECHO y|CHKDSK C: /R
ECHO y|CHKDSK D: /X/R

SHUTDOWN -r



Discussion

No Comment Found