Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

script/bat to run chkdsk once and restart

Hi,

I'd like to have chkdsk run on a computer without any user interaction.

I'd like to run chkdsk to fix all errors on the c: drive.
Then I'd like to restart the comptuer and have the chkdsk run.
Then I'd like windows to start up.

Any suggestions how I can do this?

I think what I'm looking for is a registry edit that I can schedule a chkdsk/autochk to run only ONCE during the next startup. then I can create a reboot at a certain time.

thanks!
0
vITComputing
Asked:
vITComputing
2 Solutions
 
sirbountyCommented:
I don't think you need a batch/script - that's how chkdsk works, since it can't lock the c drive...

Try it with:

chkdsk c: /x

There is a shtudown.exe that will allow you to schedule the reboot...
0
 
vITComputingAuthor Commented:
That still requires user interaction of y/n.

I am aware of the shutdown.exe, and I do plan on using that as soon as I can schedule a chkdsk/autochk to run ONCE during startup.

Thanks.
0
 
sirbountyCommented:
Oh, that's for safety sake...you can echo the answer to force it...

echo y|chkdsk c: /x
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
saw830Commented:
Hi vITComputing,

is this of any assistance?
http://support.microsoft.com/kb/218461

Hope this helps,
Alan
0
 
vITComputingAuthor Commented:
the echo command worked.  What the difference between the /f and the /x parameter?

Thanks!
0
 
vITComputingAuthor Commented:
Does the chkdsk also write to a log file somewhere or maybe the event log?

Thanks
0
 
sirbountyCommented:
/x forces a volume dismount and implies /f
0
 
sirbountyCommented:
Yes - eventlog
0
 
and235100Commented:
Yes, in the Application Event log under Source=Winlogon and EventID=1001

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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