Solved

script/bat to run chkdsk once and restart

Posted on 2006-11-20
9
1,007 Views
Last Modified: 2012-05-05
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
Comment
Question by:vITComputing
9 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 17984286
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
 

Author Comment

by:vITComputing
ID: 17984293
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
 
LVL 67

Accepted Solution

by:
sirbounty earned 80 total points
ID: 17984314
Oh, that's for safety sake...you can echo the answer to force it...

echo y|chkdsk c: /x
0
 
LVL 8

Expert Comment

by:saw830
ID: 17984345
Hi vITComputing,

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

Hope this helps,
Alan
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:vITComputing
ID: 17984358
the echo command worked.  What the difference between the /f and the /x parameter?

Thanks!
0
 

Author Comment

by:vITComputing
ID: 17984370
Does the chkdsk also write to a log file somewhere or maybe the event log?

Thanks
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17984384
/x forces a volume dismount and implies /f
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17984386
Yes - eventlog
0
 
LVL 32

Assisted Solution

by:and235100
and235100 earned 20 total points
ID: 17986732
Yes, in the Application Event log under Source=Winlogon and EventID=1001

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

13 Experts available now in Live!

Get 1:1 Help Now