Explorer: list chkdsk results

Post your working scripts, libraries and tools
User avatar
jeeswg
Posts: 6904
Joined: 19 Dec 2016, 01:58
Location: UK

Explorer: list chkdsk results

13 Mar 2019, 01:50

Code: Select all

q:: ;Explorer - list chkdsk results (tested on Windows 7)
;WER_EL_BUCKET_LOG := 1001
;STATUS_SHUTDOWN_CLEAN := 1074
;WARNING_ISSE_SHUTDOWN_CANCELLED := 1075
vEvent := 1001
oWMI := ComObjGet("winmgmts:")
oQueryEnum := oWMI.ExecQuery("Select * from Win32_NTLogEvent where EventCode=" vEvent)._NewEnum()

vOutput := ""
VarSetCapacity(vOutput, 1000000*2)
vBarrier := "=================================================="
while oQueryEnum[oEvent]
{
	if !InStr(oEvent.Message, "chkdsk")
		continue
	vOutput .= vBarrier "`r`n`r`n"
	vOutput .= SubStr(oEvent.TimeGenerated, 1, 14) "`r`n`r`n"
	vOutput .= Trim(oEvent.Message, "`r`n") "`r`n`r`n"
}
vOutput .= vBarrier "`r`n"
vOutput := StrReplace(vOutput, "`r`n", "`n")
vOutput := StrReplace(vOutput, "`r", "`n")
vOutput := StrReplace(vOutput, "`n", "`r`n")
vOutput := RegExReplace(vOutput, " +`r", "`r")

oWMI := oQueryEnum := oEvent := ""
Clipboard := vOutput
MsgBox, % "done"
return
- Link:
Win32\_NTLogEvent class | Microsoft Docs
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/eventlogprov/win32-ntlogevent

- To check manually:
eventvwr.msc
window pane on left
Windows Logs, Application, Find...
search for: chkdsk

- 3 times my PC has gone into chkdsk, and each time has deleted around a dozen random files (which chkdsk has listed). Nov 2018, Feb 2019, Mar 2019.
- I have been backing up files and creating txt file lists via File Loop.
- My plan is to backup and defrag.
- I'm just mentioning this in case anyone has any recommendations, e.g. ideas for system info to check or chkdsk results to inspect. Thanks.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 43 guests