Monday, April 26, 2010

Scandisk

UPDATE 20-04-2017:
Dism /Online /Cleanup-Image /StartComponentCleanup
Dism /Online /Cleanup-Image /RestoreHealth
SFC /scannow

https://www.tenforums.com/performance-maintenance/29947-sfc-some-corrupt-files-can-not-fixed.html

2.5. cmd -> DISM /Online /Cleanup-Image /RestoreHealth Fixing component store corruption
END OF UPDATE
UPDATE 02-04-2021:
Do you notice that sometimes you can’t login to Microsoft Teams?
I have figure out that this happens after it automatically updates itself.

I have written a little script for me to overcome this issue.
Microsoft Teams login failure after auto-update END OF UPDATE
UPDATE 06-11-2020: Комманда для запуска defrag-а:

defrag c: /U

https://www.wikihow.com/Defragment-Your-Hard-Drive-in-Command-Prompt
END OF UPDATE


UPDATE 15-11-2020:

@ECHO OFF
rem https://www.thewindowsclub.com/repair-corrupt-windows-image-error-0x800f0906
rem https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/error-1058-when-enabling-window-update-services/5fc15ed9-c849-4f42-89a6-41be90b9239a
setlocal enabledelayedexpansion


SET ERRORLEVEL
VERIFY > NUL


@ECHO ON
net stop wuauserv | echo ""
IF ERRORLEVEL 1 GOTO :EOF
net stop cryptSvc
IF ERRORLEVEL 1 GOTO :EOF
net stop bits | echo ""
IF ERRORLEVEL 1 GOTO :EOF
net stop msiserver | echo ""
IF ERRORLEVEL 1 GOTO :EOF
rd /Q /S Download
IF ERRORLEVEL 1 GOTO :EOF
rd /Q /S C:\Windows\SoftwareDistribution
IF ERRORLEVEL 1 GOTO :EOF
rd /Q /S C:\Windows\System32\catroot2
IF ERRORLEVEL 1 GOTO :EOF
rem net start wuauserv
IF ERRORLEVEL 1 GOTO :EOF
net start cryptSvc
IF ERRORLEVEL 1 GOTO :EOF
rem net start bits
IF ERRORLEVEL 1 GOTO :EOF
net start msiserver
IF ERRORLEVEL 1 GOTO :EOF
@ECHO OFF
schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\Scheduled Start" /Disable
IF ERRORLEVEL 1 GOTO :EOF
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\Backup Scan" /Disable
IF ERRORLEVEL 1 GOTO :EOF
schtasks /Change /TN "\Microsoft\Windows\WaaSMedic\performremediation" /Disable
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v AlwaysAutoRebootAtScheduledTime /t REG_DWORD /d 0x0 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v AUOptions /t REG_DWORD /d 0x2 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v AUPowerManagement /t REG_DWORD /d 0x0 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v AutoInstallMinorUpdates /t REG_DWORD /d 0x0 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAUShutdownOption /t REG_DWORD /d 0x0 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 0x1 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate /t REG_DWORD /d 0x1 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v ScheduledInstallDay /t REG_DWORD /d 0x7 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v ScheduledInstallTime /t REG_DWORD /d 0x3 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v UseWUServer /t REG_DWORD /d 0x0 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\DoSvc /v Start /t REG_DWORD /d 0x4 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc /v Start /t REG_DWORD /d 0x4 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc /v Start /t REG_DWORD /d 0x4 /f
IF ERRORLEVEL 1 GOTO :EOF
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\BITS /v Start /t REG_DWORD /d 0x4 /f
IF ERRORLEVEL 1 GOTO :EOF
@ECHO ON
Dism /Online /Cleanup-Image /StartComponentCleanup
IF ERRORLEVEL 1 GOTO :EOF
Dism /Online /Cleanup-Image /RestoreHealth
IF ERRORLEVEL 1 GOTO :EOF
defrag c: /U
IF ERRORLEVEL 1 GOTO :EOF
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe executeQueuedItems IF ERRORLEVEL 1 GOTO :EOF C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems IF ERRORLEVEL 1 GOTO :EOF C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe executeQueuedItems IF ERRORLEVEL 1 GOTO :EOF C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executeQueuedItems IF ERRORLEVEL 1 GOTO :EOF SFC /scannow


:EOF
EXIT /B !ERRORLEVEL!
rem if you can't see 'This PC' or Control Panel opened rem delete Bags and BagMRU in Computer\HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell
rem wuauclt /resetauthorization /detectnow
END OF UPDATE

Based on https://www.thewindowsclub.com/repair-corrupt-windows-image-error-0x800f0906

https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/error-1058-when-enabling-window-update-services/5fc15ed9-c849-4f42-89a6-41be90b9239a

See also https://www.toalexsmail.com/2019/05/how-to-turn-off-windows-10-updates.html

UPDATE 05-05-2021: Чуть ранее я добавил строчку:
schtasks /Change /TN "\Microsoft\Windows\WindowsUpdate\Scheduled Start" /Disable
К сожалению, довольно быстро этот task становится enable.

cd \programs\PSTools
psexec -accepteula -s -h -i %windir%\system32\mmc taskschd.msc /s
Cм. https://www.toalexsmail.com/2019/05/how-to-turn-off-windows-10-updates.html

С помощи комманды выше откройте Task Scheduler.
Task Scheduler->Task Scheduler Library->Microsoft->Windows->WindowsUpdate, task с именем "Scheduled Start" (Location: \Microsoft\Windows\WindowsUpdate). Удалите Custom Trigger. Это позволит вам редактировать task. Если вы не удалите Custom Trigger, любая попытка изменить task приведёт к сообщению об ошибке "Task Scheduler Service is not available. Task Scheduler will attempt to reconnect to it". Это потому, что Task Scheduler GUI не понимает Custom Trigger. Как только вы его удалите, вы можете спокойно редкатировать task.

1. Remove Custom Trigger (см. выше).
2. Remove "One Time" event trigger.
3. Windows Update service has a trigger defined that will start it under certain circumstances; remove it with:

sc triggerinfo wuauserv delete start/machinepolicy
4. For the task being recreated/overwritten problem, disable it in Task Scheduler first then take away write permission for the SYSTEM account on the file C:\Windows\System32\Tasks\Microsoft\Windows\WindowsUpdate\Scheduled Start.

Based on:
https://msfn.org/board/topic/177863-task-scheduler-cannot-remove-scheduled-start-task/?do=findComment&comment=1155596
https://msfn.org/board/topic/177863-task-scheduler-cannot-remove-scheduled-start-task/?do=findComment&comment=1155525
https://msfn.org/board/topic/177863-task-scheduler-cannot-remove-scheduled-start-task/page/1/

END OF UPDATE
В Windows 98 была такая утилита scandisk в System tools, в Windows XP её убрали, есть некий её огрызок который можно вызвать зайдя в Properties диска в таб tools, нажав в Error-checking кнопку Check Now появляется этот огрызок. В нём настроек почти нет. Он имеет также тенденцию выдавать сообщение об ошибке "Windows was unable to complete the disc check". Что с этим делать непонятно.
Вылечить эту проблему мне помогла комманда

chkdsk c: /X

См. ниже подробности как запускать. Ключ /? даст описание всех опций.
После её запуска я получил сообщение:


The type of the file system is NTFS.
Cannot lock current drive.

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)

Нажав "y" и enter и перезапустив компьютер "scandisk" запуститься при старте Windows.

В следующий раз я попробую команду

chkdsk /R /X


CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]


volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
...
/F Fixes errors on the disk.
...
/R Locates bad sectors and recovers readable information
(implies /F).
...
/X Forces the volume to dismount first if necessary.
All opened handles to the volume would then be invalid
(implies /F).



...if some of the core components which are necessary to run disk defragmenter tool got corrupted.

To resolve the above problem do the followings:-

1]Start>Run>type SFC /PURGECACHE >ok
2]Start>Run>type SFC /SCANNOW >ok
3]Start>Run>type chkdsk c: /r>ok
4]Start>Run>type Prefetch>ok. Select all the files and delete them. ('prefetch' is not recognized as an internal or external command, operable program or batch file).
5]Restart the computer.

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

UPDATE: 04-09-2010 Если вы хотите отключить запуск Scandisk-а при start-upе введите следующу комманду: chkntfs /x c: (для двух дисков введите chkntfs /x c: d:). Эта комманда меняет BootExcecute в registry по адрессу:

HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\Session Manager

Значение по умолчанию "autocheck autochk *". Запуск "chkntfs /x" меняет его на "autocheck autochk /k:*". Параметр /k исключает тестирование дисков.

См. http://www.raymond.cc/blog/archives/2008/02/23/disable-or-stop-auto-chkdsk-during-windows-startup/
END OF UPDATE

UPDATE: 05-09-2010: My Windows XP Cleanup Todolist Russian END OF UPDATE.

UPDATE: 08-12-2011:Случайным образом появляется сообщение об ошибке, что сайт не найден
END OF UPDATE

1 comment:

  1. http://www.pcreview.co.uk/forums/windows-xp-defrag-doesnt-work-t2678913.html Service "DCOM Server Process Launcher" should run in order to start defrag.

    ReplyDelete