'---------------------------------------------------------------------------------------------- 'This script launches chkdsk and sends keys to the UI in order to automate the chkdsk 'process. '---------------------------------------------------------------------------------------------- set WshShell = CreateObject("WScript.Shell") 'Launch chkdsk from the command line and wait for a second WshShell.Run "chkdsk /f" WScript.Sleep 200 'Bring the application to the foreground WshShell.AppActivate "C:\WINDOW\system32\cmd.exe" WScript.Sleep 1000 'Send a y key to confirm chkdsk on reboot WshShell.Sendkeys "Y" Wscript.Sleep 100 'Send key to input the above choice WshShell.Sendkeys "{ENTER}" Wscript.Sleep 100