title: Wait until Symantec End Point DoScan.exe finishes scanning the file
body: <p>I am developing an application which uses file upload. My client uses Symantec End Point Protection on Windows Server.</p>
  
  <p>So, I am using a sample code to check whether a file being uploaded on server.</p>
  
  <p>I am calling SEP using command line.</p>
  
  <p>Sample Code:</p>
  
  <pre><code>              String[] commands =  new String[6];
                commands[0] = "cmd";
                commands[1] = "/c";
  
                commands[2] = "C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\DoScan.exe";
                commands[3] = "/cmdlinescan";
                commands[4] = "/ScanFile";
                commands[5] = fileName;
  
               Process process = Runtime.getRuntime().exec(commands);
  
               int exitVal = process.waitFor();
  </code></pre>
  
  <p>I have also came across that, SEP generates a daily log for each scanned file at .</p>
  
  <pre><code>scanResult = "C:\\Documents and Settings\\All Users\\Application Data\\"Symantec\\Symantec Endpoint Protection\\Logs\\";   
  </code></pre>
  
  <p>So, Here I want to scan the file.</p>
  
  <p>I have placed check that start reading file at location. Once It returns 0 from the process</p>
  
  <p>But <code>"int exitVal = process.waitFor();"</code> gets returned before SEP writes log to the file.</p>
  
  <p>So, Is SEP <code>"DoScan.exe"</code> calls thread interanlly to start scanning the file.</p>
  
  <p>if Yes, Please suggest me an alternative.</p>
  
  <p>Any help would be appreciated</p>