Don't bother wasting your time, just implement a 3rd party command line scanning tool (CLScan) like I did. My users are happy with the solution. Download it from here...