Private Sub StartScanDisk()
Dim lPid As Long
Dim lHnd As Long
Dim lRet As Long
Const strCmd As String = "C:\WINDOWS\SCANDSKW.EXE /noninteractive"
lPid = Shell(strCmd, vbNormalFocus)
If lPid <> 0 Then
'Get a handle to the shelled process.
lHnd = OpenProcess(SYNCHRONIZE, 0, lPid)
'If successful, wait for the application to end and close the handle.
If lHnd <> 0 Then
lRet = WaitForSingleObject(lHnd, INFINITE)
CloseHandle (lHnd)
End If
End If
End Sub