Hi ScumPuppy,
Unfortunately this will not work since SFC.exe , or Windows File Protection scan (in windows XP at least) is not running under SFC.exe but under different service.
SFC.exe just executes Winlogon.exe function that scans the files for Windows File Protection, so the result you see where START /WAIT command is not working is actually true since SFC.exe just executes the function and then closes immediately. Winlogon.exe is the process that actually shows you the Windows File Protection scan and progress screen. And you can't really wait for Winlogon to close in your batch file since this process is a core system process and is always on.
What you can use is this:
tasklist /FI "WINDOWTITLE eq Windows File Protection" | FIND "winlogon.exe"
Command above will look for a window title called "Windows File Protection" and will PIPE that command to FIND command that will look for "winlogon.exe" and if it DOESN'T find it, it will be at ERRORLEVEL 1
Example script below can demonstrate this:
Hope this helps :-)
Main Topics
Browse All Topics





by: QlemoPosted on 2009-05-19 at 07:43:19ID: 24422558
If you call sfc without start, does it wait? It does on my Vista PC.