Endpoint Protection

 View Only
  • 1.  How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#



  • 2.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#
    Best Answer

    Posted Oct 03, 2019 09:24 AM

    Hi Harpreet,

    Most of the time I user powershell, but if you are looking for any application launch ( .exe ) with arguments , this is the blue print

     

    using System.Diagnostics;
    
    // Prepare the process to run
    ProcessStartInfo start = new ProcessStartInfo();
    // Enter in the command line arguments, everything you would enter after the executable name itself
    start.Arguments = arguments; 
    // Enter the executable to run, including the complete path
    start.FileName = ExeName;
    // Do you want to show a console window?
    start.WindowStyle = ProcessWindowStyle.Hidden;
    start.CreateNoWindow = true;
    int exitCode;
    
    
    // Run the external process & wait for it to finish
    using (Process proc = Process.Start(start))
    {
         proc.WaitForExit();
    
         // Retrieve the app's exit code
         exitCode = proc.ExitCode;
    }
    
    https://stackoverflow.com/questions/240171/launching-an-application-exe-from-c


  • 3.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Mar 30, 2020 11:52 AM
    I'm working to a website with a form where the user can upload a file and i developed a method that performs a realtime scan of the files uploaded on the website (.net application in c#).
    I have a problem, i get always 0 as exitcode and i fear that the string i specify as Arguments to the process object is wrong and that the file scan is not executed at all.


    Process p = new Process();

    string exefileName = "\"C:\\Program Files (x86)\\Symantec\\Symantec Endpoint Protection\\DoScan.exe\"";

    ProcessStartInfo processInfo = new ProcessStartInfo();
    processInfo.FileName = exefileName;
    processInfo.Arguments = "/c \"C:\\Program Files (x86)\\Symantec\\Symantec Endpoint Protection\\DoScan.exe\" /ScanFile \"E:\\WWW\\myfolder\\myfile.com\"";
    p.StartInfo = processInfo;

    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;

    p.Start();
    p.WaitForExit(5000); //wait

    int exitCode = -1;
    if (p.WaitForExit(5000))
    {
    exitCode = p.ExitCode;
    }


    Can you help me please?
    Thanks


  • 4.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Oct 04, 2019 03:11 AM

    Can anyone tell me how to create a separate log file for each scan as I am using version 14.2.3332.1000.105



  • 5.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Oct 04, 2019 04:03 AM

    Thanks Rafeeq and can you please tell me what paramter to pass to create a separate log file for each scan



  • 6.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Oct 04, 2019 04:49 AM

    Hi Harpreet,


    DateTime date = DateTime.Now; // will give the date for today
    string dateWithFormat = date.ToString("dd - MM - yyyy");

    /logfile="c:\temp\LogFile-DatewithFormat.log"

    Do you see /logfile in the cmd line options? I belive it doesnt exist in version 14.XXX

    please check this code as well

    https://www.codeproject.com/Questions/418603/Calling-DoScan-exe-utility-from-Command-Line

     



  • 7.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Oct 04, 2019 04:52 AM

    Hi Rafeeq,

     

    I already check these options as nothing works for version 14 these options are worked till version 11.



  • 8.  RE: How to use DoScan.exe to start a Symantec Endpoint Protection (SEP) client scan from a command-line in Asp.net c#

    Posted Oct 04, 2019 07:04 AM

    Hi Harpreet,

    the /logfile does not exist in newer versions, time to add an enchancement request

    https://support.symantec.com/us/en/article.tech215657.html