• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

scheduling disc check without confirmation

Hi experts

I am trying to put together some maintenance scripts and I am hitting one dead end.

I hope it is simple enough for someone to figure out.

I need to run a script and one of the actions that the script need to carry out is schedule the disc check.

The problem is that the command "chkdsk c:" requires answer to the question "this can't be done, do u want to schedule it for next reboot? yes or no"?.

There might be another way to schedule a disc check on the next reboot but this is how I am trying to do it.

I do know there is a way to schedule a task itself using a command line with the schedule of "ONSTART" but that is probably of no use because that will schedule the task to run on every boot. Then I will have to figure out a way to delete the task.

But I can save all this trouble if I can just figure out how to run the "Chkdsk C:" command and answer yes to the question automatically.

Can someone help me with this?

0
alex110109
Asked:
alex110109
2 Solutions
 
sjklein42Commented:
echo Y | chkdsk c:
0
 
☠ MASQ ☠Commented:
Would chkntfs /c C: (for drive C:) achieve what you want?
http://support.microsoft.com/kb/160963
0
 
alex110109Author Commented:
Sjk & Masq

Great work by both of you.

Both have the solution to my problem.

ANd thanks to Masq, I learned about another tool for the maintenance script I am trying to prepare.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now