Solved

script/bat to run chkdsk once and restart

Posted on 2006-11-20
9
1,009 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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
 

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

825 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