It is possible for malware to persist across a re-format and re-install, if it is sufficiently ingenious and sophisticated, however most malware doesn't do anything quite this nasty. I've done this thousands of times and always worked for me so i don't really see how this doesn't work.