start /wait command not working in batch file with sfc.exe /scannow
Posted on 2009-05-19
Im trying to utilise the start /wait command in my batch file so the batch will wait until sfc.exe finishes before it carries on. At the moment I have to use 'pause' so it waits for me to click any key to continue after if has run.
I cant seem to get it to work. Im trying
Start /wait "" "c:\windows\system32\sfc.exe" /scannow
echo has it worked?
In theory this should run sfc.exe and not give me the message "has it worked" until it has finished scanning. But it doesnt, it gives me that message straight away.
The long story is i want to perform a few other tasks after sfc.exe has run but I want it to run the scan before the other tasks run.
Ive tried re-wording it, I recently found out about adding the dummy string in at the front with the "", Im at a loss, can anyone help please?