
Public void PerformScanning(string strfiles, string strFilePath,string strDestPath) The only exception that the code throws is file not found, and it is refering to the log file which is not gereated by the DoScan.exe Here the DoScan.exe doest get called and no log file get generated. It works perfectly in XP but donno y it doest work in Windows server 2008. Ok below is the code which intended to scan the files from a specified path to moves the scanned files to a target folder.It creates log files for the files whose scanning process has started. ObjFileStatus.UpdateUploadedFileStatus( " Failure", " N", strFile, Path.GetFileNameWithoutExtension(strFile).Substring( 6, Path.GetFileNameWithoutExtension(strFile).Length - 6), " Virus Found") Ĭonsole.WriteLine( " File:" + path + " Deleted.") Ĭonsole.Write( " The Process Cannot be completed due to some exception") ObjFileStatus.UpdateUploadedFileStatus( " Sucess", " Y", strDestPath + " \\" + Path.GetFileName(strFile), Path.GetFileNameWithoutExtension(strFile).Substring( 6, Path.GetFileNameWithoutExtension(strFile).Length - 6), " No threat detected") Ĭonsole.WriteLine( " File:" + strFile + " Scanned Sucessfully") įile.Delete(strFilePath + " \\Logs\\" + Path.GetFileName(strFile) + ". If (File.Exists(strFilePath + " \\" + strfiles))įile.Delete(strFilePath + " \\" + strfiles) ObjStreamReader = File.OpenText(FILENAME) įile.Move(strFile, strDestPath + " \\" + Path.GetFileName(strFile)) StreamReader objStreamReader = default(StreamReader) String FILENAME = strFilePath + " \\Logs\\" + Path.GetFileName(strFile) + ".



String myprocarg = " C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\DoScan.exe /cmdlinescan " + strFile + " /LOGFILE=\\" + strFilePath + " \\Logs\\" + Path.GetFileName(strFile) + ". = " C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\DoScan.exe" If (!Directory.Exists(strFilePath + " \\Logs"))ĭirectory.CreateDirectory(strFilePath + " \\Logs") Public void PerformScanning(string strfiles, string strFilePath, string strDestPath)
