fix disk errors for all partitions at once

please use the script to get all your disk errors be fixed in all partitions. fix errors for the active disk (C: in most cases) will be performed once your computer gets restarted.

## fixes errors on the HDD
## collect all type 3 drives - HDD drives
from subprocess import PIPE, Popen
p = Popen('wmic logicaldisk where drivetype=3 get name', shell=True, stdout=PIPE, stderr=PIPE)
o, e = p.communicate()
ls = o.split('\r
')
cls = []
for i in ls:
    i = i.strip()
    if i != 'Name' and i != '':
        cls.append(i)
cls = ' '.join(cls)
##print cls

## perform chkdsk operation for each drive
ch = Popen('for %i in ({}) do echo y | chkdsk %i /f'.format(cls), shell=True, stdout=PIPE, stderr=PIPE)
ot, er = ch.communicate()
print ot

sample output:

Last line “print ot” - is it right?

Is it scans all partitions of hard drive? How about “System reserved” partition? And partitions next after C: ?

Hi Sergey ,

Last line “print ot” - is it right?

Yes , it is correct.

Is it scans all partitions of hard drive? How about “System reserved” partition? And partitions next after C: ?

Procedure run windows internal tool “chkdsk” to scan and applying it to all available partitions within endpoint.

Yes,It is possible with check system reserved partition. We will modify the procedure and let you know.

Is procedure can find all partitions and scan it (or plan for chkdsk)?

Procedures support reboot-break? Mean procedure1 done, need to reboot PC, after reboot running procedure2

C:\Windows\system32>echo y | chkdsk C: /f �⪠���� � ����㯥: �������筮 �ਢ������. ������ �।�⢮ ����室��� ����᪠�� � ����襭�묨 �ࠢ���. C:\Windows\system32>echo y | chkdsk D: /f �⪠���� � ����㯥: �������筮 �ਢ������. ������ �।�⢮ ����室��� ����᪠�� � ����襭�묨 �ࠢ���. C:\Windows\system32>echo y | chkdsk E: /f �⪠���� � ����㯥: �������筮 �ਢ������. ������ �।�⢮ ����室��� ����᪠�� � ����襭�묨 �ࠢ���. collaps

This is procedure log at ITSM

Hello @Sergey

As you can see, the post you made does contain character that are undecipherable. Is this how you see it in the log as well?

Yes, I copy/pasted it.

Hello @Sergey ,

Procedure Logs are not displaying Russian characters correctly at the moment. An improvement for this is planned for end of Q2 2017.

Then also fix please same problem with SendMessage procedure.