How to save chkdsk results to a .txt file?

18,908

Solution 1

I found where Windows XP stores the output of the chkdsk run on boot. It stores the output in C:\Bootex.log

http://support.microsoft.com/kb/218461

EDIT: On a side note. I'll share this with everyone

To automate chkdsk via batch file, you can use the following commands:

echo y|chkdsk /f
shutdown -r -t 00

then you can retrieve the Bootex.log from C:\ afterwards.

EDIT2: Not sure what the default behavior is but it seems that it is hit and miss with whether or not a bootex.log exists. I saw a post on another website stating that bootex.log is supposed to be erased before login, unless autochk.exe encounters an error or if autochk.exe is canceled before it is finished. But I've seen the log there without either conditions being met.

Solution 2

You can use redirection.

Run chkdsk over a command window(cmd):

  1. Click on Windows Start buttom / type "cmd" and open a new cmd window.

  2. Type the following comand(without the ""):

    "chkdsk > log.txt"

Then all the content shown on cmd output will be written to the log.txt file.

Here is the print screen of the results performed with this command at my system(Portuguese Windows version):

enter image description here

Solution 3

Expanding on crokusek's answer, you can access the chkdsk full log file in Drive:/System Volume Information/Chkdsk/Chkdsk*.log.

To get to the files from Explorer you have to give yourself read permission on System Volume Information and its Chkdsk subdirectory.

  1. First go to Folder & search options (Organize menu in Explorer window), View tab, and uncheck Hide protected operating system files. This will allow you to see the System Volume Information folder in the root directory.
  2. Right click on System Volume Information -> Properties -> Security tab. Click Continue.
  3. On the dialog that opens, click Add.
  4. Write your username and click Check names. The name should transform to hostname\username.
  5. Click OK everywhere. Some errors will pop up about denied access to some folders. Ignore them and click Continue. This will add read, execute and list permission to your user.
  6. Repeat from step 2 for the Chkdsk folder.

Solution 4

At least for Windows 7, the output of chkdsk appears:

1) In Event Viewer but it can be truncated if it is very long.

2) Drive:/System Volume Information/ChkDsk/Chkdsk*.log

These seem to work even if chkdsk is run during boot up sequence.

For #2, I had to use cygwin to get into the directory so maybe someone can post a link on how get it in there another way. Simply opening explorer as Admin does not work.

Share:
18,908

Related videos on Youtube

Anthony Miller
Author by

Anthony Miller

"Your competition is a hungry immigrant with a digital handheld assistant. America is made up of immigrants... if your children are to be successful they must act like immigrants in their own country. Just by being born here doesn't give you the ability to be successful... it is the work ethic... the pioneering ethic... the service ethic that will win. Your competition is always a hungry immigrant with a digital assistant: hungry in the belly for food, hungry in the mind for knowledge, and the hunger is something that should never leave you." ~Dr. Dennis Waitley

Updated on September 18, 2022

Comments

  • Anthony Miller
    Anthony Miller almost 2 years

    Is there a way to get the results of chkdsk with the /f switch to a .txt file instead of having to go to the event viewer?

    EDIT: I want to get the output of what chkdsk fixed, not just what errors have been shown.

    PS: Im using Windows XP.

  • Anthony Miller
    Anthony Miller almost 13 years
    If the machine was on and running, and you run chkdsk /f in cmd, it will ask to restart the machine to run chkdsk. When you go to restart the machine, the session is killed. If I understand correctly, won't doing chkdsk >> log.txt only output the message prior to the actual chkdsk application running?
  • Diogo
    Diogo almost 13 years
    On boot time you cannot schedule to pipe to a txt or even save the results, but you can add the command chkdsk > log.txt to a script and run it everytime you boot the system.
  • Diogo
    Diogo almost 13 years
    You could edit your question and ask how to get a txt file from the event view using a command....
  • Diogo
    Diogo almost 13 years
    Sorry, I think I misunderstood your first comment. If you run chkdsk with /f argument it will ask you for schedule the chkdsk task to the next boot in order to correct defective clusters. chkdsk without arguments will verify your disk for errors and give a error report. If you got erros on report you can run /f argument, if dont, you can use chkdsk without arguments piping to the .txt log to see if there are errors, you will get the same information that would have if was on boot time.
  • Anthony Miller
    Anthony Miller almost 13 years
    ahhh i see. Even that is helpful however. And the miscommunication was on my part for not specifying the /f switch in the question.
  • MrWhite
    MrWhite almost 13 years
    Just a minor point on terminology, what you are demonstrating is 'output redirection' using the > operator, not strictly a pipe. A pipe is when the output of one program is used as the input to another, as in 'piped from one program to another' using the | operator.
  • Anthony Miller
    Anthony Miller almost 13 years
    I was going to say something about it but I figured he was foreign and let it slide =P
  • psusi
    psusi almost 13 years
    @Diogo_Rocha, it is /r, not /f that scans for bad clusters.
  • Diogo
    Diogo almost 13 years
    Both /r and /f scan and try to correct bad clusters, at least it is what chkdsk /? says.
  • Diogo
    Diogo almost 13 years
    The link is broken("Sorry, but we couldn't find the page that you requested."). Can you verify if it is right?
  • Anthony Miller
    Anthony Miller almost 13 years
    cut off a number at the end =/ it should work now
  • Anthony Miller
    Anthony Miller almost 13 years
    and yes yes I know it says "IN windows 2000" but it still applies to windows xp. tested and found it with the output file after the system reboot.