[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1552
  • 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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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