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

Need to setup CHKDSK /f /r as a scheduled task

In my company's network, I have all 120 of my XP Workstations on a weekly reboot and defrag schedule using scheduled tasks.  I have this pushed out through a Group Policy login script that runs a batch file which creates the scheduled tasks and runs them under the System account.  It has been working well.

I would like to add Chkdsk to this automatic weekly maintenance as well.

Is there a way I can run a .bat file that will run "chkdsk c: /f /r" AND confirm yes to run it upon reboot when it asks:  "Chkdsk cannot run because the volume is in use by another precess. Would you like to schedule this volume to be checked the next time the system restarts?"
0
ES13Raven
Asked:
ES13Raven
  • 2
  • 2
1 Solution
 
Mark SkrodzkiSenior Systems EngineerCommented:
Hi ES13Raven,

Have you tried, "chkdsk c: /f/r/y" in your bat file?

Cheers!
0
 
ES13RavenAuthor Commented:
Yes, you get an "invalid parameter - /y" so it doesn't work
0
 
ES13RavenAuthor Commented:
Found it:

echo y|chkdsk c: /f /r
0
 
Mark SkrodzkiSenior Systems EngineerCommented:
ES13Raven,

Great find!!!

skrodzkim
0
 
NetminderCommented:
Closed, 250 points refunded.
Netminder
Site Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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