Solved

scheduling disc check without confirmation

Posted on 2011-02-12
3
469 Views
Last Modified: 2012-05-11
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
Comment
Question by:alex110109
3 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 250 total points
ID: 34880620
echo Y | chkdsk c:
0
 
LVL 62

Assisted Solution

by:☠ MASQ ☠
☠ MASQ ☠ earned 250 total points
ID: 34880631
Would chkntfs /c C: (for drive C:) achieve what you want?
http://support.microsoft.com/kb/160963
0
 

Author Closing Comment

by:alex110109
ID: 34883968
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now