Why doesn't my automated checkdisk scan run?

Mackintire

2[H]4U
Joined
Jun 28, 2004
Messages
2,986
This is a repost, as no one has answered the question as of yet.


So I have a batch file that I am calling using the scheduled task manager to run scandisk on a machine after hours.


The contents of the batch file are:

echo y > confirm.txt
echo y|chkdsk C: /f /r /x < confirm.txt
echo y|chkdsk E: /f /r /x < confirm.txt
echo y|chkdsk F: /f /r /x < confirm.txt
shutdown -r -t 10



The batch file created the txt file, rebooted but only scanned C:

Can you tell me what's wrong with this syntax?
 
Are you only seeing c: scanned in the event log?

If the other two drives are succesfully breaking file locks, they are not scheduling the chkdsk to occur after a reboot, they will start running chkdsk during the execution of the batch file. They will run to completion, then move on to the next line of the batch file.

It may be only the C drive requires the reboot before it checks the volume. Only checks done during the reboot sequence record results in the event log.

What is the time difference between the time the batch file is scheduled to launch, and when the system actually reboots?

(this is also more of an OS question than a networking and security question)
 
Well it somewhat works now:

I think it did complete, but I have no record of scandisk completing on disks E or F
It still is generating an error in the scheduled tasks log.
Personally I think that the shutdown line is causing that.
I 'll keep at it until this is resolved.

I 've edited the batch file to this:

echo y > confirm.txt
echo y|chkdsk E: /f /r /x < confirm.txt
echo y|chkdsk F: /f /r /x < confirm.txt
echo y|chkdsk C: /f /r /x < confirm.txt
shutdown -r -t 10
 
don't you use ">>" to append output to a file?
yet you're showing "<"

> to output to file
>> to append output to file

< is for...?

edit: that could be the reason for only the C drive getting logged. You are overwriting the log file, instead of appending, and your C drive is last :p
 
< confirm.txt is typing a y back to the previous command. You can theoretically have 2 yes responses on a chkdsk command.

Echo y is sending the first yes response though the pipe.
 
< confirm.txt is typing a y back to the previous command. You can theoretically have 2 yes responses on a chkdsk command.

Echo y is sending the first yes response though the pipe.

ahhhhh okay. I didn't know that's how that was done :p
 
Back
Top