Question

chkdsk /f after windows startup

Asked by: CarlCCTVSI

Hi Experts,
I want to run chkdsk /f after windows has started up on my D: drive.  The D: drive is a USB Generic Hub drive and therefore won't be seen until windows is started.  I can initiate the chkdsk by having a piece of VBS code that does the chkdsk /f command that is called from the registry in the run key, however, I always get an error:

Chkdsk cannot run because the volume is in use by another
process.........

If I don't run it from the registry, but run in manually I don't get the error.  If I use a delay before running it, of say 30 seconds, I still get the error, but if I don't bother with the delay, but run it manually I don't.

CAn anyone point me in the direction of what I need to do?  To clarify, I need to chkdsk /f my D: drive after windows starts, so that windows has time to see it.  I want it to do it on every boot.

Thanks folks.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-11-02 at 05:31:29ID24863516
Tags

Windows XP

,

chkdsk

Topic

Windows XP Operating System

Participating Experts
4
Points
0
Comments
10

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. CHKDSK @ startup
    Hi, can anybody tell me how can I have CHKDSK perform scan everytime windows has been shut or restarted inproperly just like in windows 9x. I have recently installed 2000 and it seems this is not a default. Thanks in advance. Blago
  2. problems with chkdsk
    Hi, When I run chkdsk in XP, without the /F I get the following info: C:\>chkdsk The type of the file system is NTFS. WARNING! F parameter not specified. Running CHKDSK in read-only mode. CHKDSK is verifying files (stage 1 of 3)... File verification completed. CHKDSK i...
  3. CHKDSK Scheduled
    I have a 2003 server that wants to run CHKDSK upon boot. There was a HD issue which has been corrected (RAID5, replaced drive). No, when the server restarts it wants to run CHKDSK. Normally this is not an issue. But this server has an extremly large vomune and would take ...
  4. chkdsk issue
    received this from a friend: I had to do a hard shutdown earlier today and since then, Chkdsk runs on both partitions on every startup. I just tried to defrag and it denies a defrag because it detects that a Chkdsk is scheduled. I've run Chkdsk at least twice, but it still i...
  5. Chkdsk report
    Running chkdsk /f at startup 4 times in a row I get the following winlog report: Cleaning up minor inconsistencies on the drive. Cleaning up 1 unused index entries from index $SII of file 0x9. Cleaning up 1 unused index entries from index $SDH of file...
  6. Cannot skip chkdsk at startup with USB keyboard
    Windows 2003 ENT 64-bit - I am not able to skip the check disk function when Windows starts, because the keyboard doesn't seem to be loaded. It works in both BIOS but when chkdsk loads it disables the keyboard. Our Dell 2950 does not have a ps/2 port. Any ideas on this one?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: zvitamPosted on 2009-11-02 at 05:47:15ID: 25719180

I would try to do it using scheduled taks - 5 minutes after windows starts.

the process that uses drive d: might an anti-virus or some other utility that scans all the drives after startup.

hope that helps,
Zvitam.

 

by: CarlCCTVSIPosted on 2009-11-02 at 05:52:21ID: 25719226

Hi zvitam

I hear you, however, there is no anti-virus running on the machine, and nothing doing on drive D:  - it is a digital video recorder so as soon as it finishes the chkdsk it loads up its DVR software - I can't wait 5 minutes.  The only thing D: is used for is storing the video.  So it shouldn't be doing anything before the software is loaded.

 

by: kadafitcdPosted on 2009-11-02 at 06:43:08ID: 25719728

You could try setting up the autochk in the registry to check the drive.  Just like if windows finds a drive set to dirty and wants to run a chkdsk at startup but this way you're manually setting it up.  

Here is an article on how to turn it off.  You can use it to see the screenshots of what it looks like
http://www.raymond.cc/blog/archives/2008/02/23/disable-or-stop-auto-chkdsk-during-windows-startup/

You could go into that Registry key and set the Boot Execute to: autocheck autochk /m:D

Refer to this article to see that the autocheck autochk /m:D will perform a chkdsk /f every startup even if the dirty attribute isn't set.
http://www2.isye.gatech.edu/~mgoetsch/cali/Windows%20Configuration/Windows%20Configuration%20Html/ModifyingDefaultBootupRunofCHKDSK_F.htm

Good Luck HTH.

 

by: CarlCCTVSIPosted on 2009-11-02 at 06:53:00ID: 25719851

Hi,

Yep, tried that before, the problem is that Windows doesn't see the drive at startup, it takes a couple of seconds or so befor eit recognises that there is a drive on the end of D: autocheck just plain fails.

Thanks though.....

 

by: pcspecialistsPosted on 2009-11-02 at 21:44:54ID: 25726315

This is how my backwards logic works:

In order to startup Windows, that means you must be shutting down Windows at some point (or restarting at least).  Would this work for you?

Just prior to shutdown exit your DVR software (or whatever is accessing drive D:)

Make this simple batch file and create a shortcut icon that points to it:
chkdsk d: /f
shutdown -s -t 5

When you click the icon it will automatically chkdsk the D: drive and shut off the computer 5 seconds after chkdsk completes.

If you want a restart just use -r instead of -s.

That way your drive will be checked and ready to go the next time you start the computer.

If you aren't manually shutting down the computer, you could set the script to run as a Windows Task periodically, once a day, once a week, whatever.

 

by: CarlCCTVSIPosted on 2009-11-02 at 23:32:00ID: 25726681

Hi pcspecialists

Thanks for the idea, I have another spanner to throw into those works I'm afraid.  The lesson for me here is to provide more infor before qsking the question - sorry all.
So here is the spanner:
The DVR has a hardware timer built into it, that shuts it down 30 minutes after the power has been turned off.  It does to a windows shutdown though, problem is it isn't something I can add or remove functions to, so getting it to chkdsk at the end of its recording as apposed to startup isn't going to work.
It was a good thought though.

Any more ideas?

 

by: pcspecialistsPosted on 2009-11-03 at 08:29:24ID: 25730650

See if this works:

At the command prompt type chkdsk d: /f /x

You should get a message back that says "Chkdsk cannot run because the volume is in use by another process.  Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)"  Press Y, exit the command prompt, and restart the computer.  Watch to see if you drive is chkdsk'd automatically.  It will happen on a text screen during the Windows bootup before login/desktop but after USB drivers are loaded which sounds like just what you need.

If it runs, I can help you setup a script to automate the command (so you don't have to press Y every time) and we'll put it in the Startup folder so it will always be scheduled to run upon the next bootup.

 

by: CarlCCTVSIPosted on 2009-11-03 at 09:23:02ID: 25731245

Hi pcspecialist

Nope no joy on that one I'm afraid.  However, how's this for a piece of lateral thinking.  I created a vb script file, plonked it in c:\ and told the registry hklm\software.......\run the entry of c:\\chkdskdvr.vbs

chkdskdvr.vbs code in a nutshell is as follows:

Set WshShell = CreateObject("WScript.Shell")
Log File = "c:\drivecheck.txt"
WScript.sleep 29000
WshShell.Run "%comspec% /c echo ********* Checking drive D ******** >" & LogFile, 8, True
WshShell.Run "%comspec% /c echo y|chkdsk.exe /f D: >>" & LogFile, 2, True

it then runs the DVR exe and all seems fair in love and war.

Thanks to everyone, it was a bit of a head scratcher to start with, but seems really obvious now it works.

 

by: ee_autoPosted on 2009-12-19 at 01:16:56ID: 26086253

Question PAQ'd, 500 points refunded, and stored in the solution database.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...