1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How to run chkdsk automatically?

Discussion in 'Windows XP' started by Gaston, 2006/02/22.

  1. 2006/02/22
    Gaston

    Gaston Inactive Thread Starter

    Joined:
    2004/09/01
    Messages:
    103
    Likes Received:
    0
    Hi, I like to automate chkdsk to run at night while i am sleeping, i found on Ms-website the article 197527 or Q197527 how to automate chkdsk i done what they said, but that does not work.Can you show me step by step what to do?...thanks
    PS. I posted that thread in ms-newsgroups i didn't like the anwser i was directed to a web site only to read how to run chkdsk at boot time
     
  2. 2006/02/22
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    You can use Task Scheduler to do this. Create a batch file and then schedule the batch file to run whenever you want it to. To defrag your only your c drive, make a batch file with the following line.
    Code:
    defrag c:
    That's all that should be needed. If you have more than one drive you can put them in there too if you want.
    Code:
    defrag c:
    defrag d:
    defrag e:
    This will defrag c, d and e. It'll do c first then d, then e.

    Only one catch here though. For task scheduler to run, you have to log on to the windows account you're going to run it from with a password. No password, task scheduler won't work. So, if you currently don't use a password to log on, you need to create one. You can still log on automatically though by using TweakUI. Create a password, then in TweakUI go to logon>autologon.
     

  3. to hide this advert.

  4. 2006/02/22
    Gaston

    Gaston Inactive Thread Starter

    Joined:
    2004/09/01
    Messages:
    103
    Likes Received:
    0
    chkdsk

    hi, i don't want defrag my c: drive,i want run chkdsk on a regular basis at night while sleeping,so i have to automate a reboot to do the task, so if i insert these keys in a batch file: @echo off
    echo y|chkdsk C:/f/r
    rem c:\utils\shutdown.exe /l /r /y /t:6

    Do you thing that will do the task?
     
  5. 2006/02/22
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    OOPs! Sorry about that. I don't know what got me thinking defrag. Maybe not enough sleep last night. :)

    Anyway, I has a second look at Q197527 and I noticed it's for WinNT. Now, shutdown.exe may work on XP just fine but I don't know for sure. My guess it will but the first thing that comes to mind is do you have shutdown.exe in the folder mentioned? If not, you'd have to download it first (link below).

    If you have it and things don't work, there's a problem with the batchfile the way you have it. You have to remove the "rem" in front of the line that says this.
    Code:
    rem c:\utils\shutdown.exe /l /r /y /t:6
    It needs to look like this.
    Code:
    c:\utils\shutdown.exe /l /r /y /t:6
    The rem in front of the line tells the computer that the line is only a remark and to ignore it. So, it skips by the line and doesn't execute it.

    I don't know why they put it that way in the KB article other than the fact I noticed below that it says that the line is optional. Seems kind of dumb that they did it that way though. Anyway, if you have shutdown.exe try it this way. If not, you can download it here. I don't know if this is the MS one though. It says it was designed for Windows XP and 2K so it should work. The page it's on belongs to a MS MVP so......
    A Google search for shutdown.exe will get you a bunch of hits. Regardless, no matter what you use to shut it down, you have to remove that rem or it won't work.

    Also, if you download the file remember to either put in the same folder as the one mentioned in the KB article or else change the path in the batch file accordingly.
     
  6. 2006/02/22
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    One more thing. If you download that file I linked to it appears you'll probably have to change the switches in the command line for shutdown.exe. I had a look at the instructions and it appears they're different than the ones in your batch file. Have a look at the instructions while you're there. If you need help with it post back.
     
  7. 2006/02/22
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    One more thing. :D While searching for an answer how to do this I came across a way you can use scheduled tasks without a password. Something I've never seen before but Kelly knows her stuff so I'm sure it works. See her reply in this thread.
     
  8. 2006/02/23
    Gaston

    Gaston Inactive Thread Starter

    Joined:
    2004/09/01
    Messages:
    103
    Likes Received:
    0
    chkdsk

    Hi, there's any ways to test if chkdsk is running?...Thanks
     
  9. 2006/02/23
    Zander

    Zander Geek Member Alumni

    Joined:
    2002/01/07
    Messages:
    4,084
    Likes Received:
    5
    There should be an event written to the event viewer when it runs.

    Click start>run and type eventvwr.msc. I don't remember for sure where it is but I believe it's under application. Look under the source column for an event named winlogon. Double click on it to see the details.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.