Endpoint Protection

 View Only

DoScan.exe – SEP Antivirus scans from Command Prompt – Introduction 

Jan 24, 2013 08:14 PM

Probably not everyone is familiar that there is a quite easy way to run quick or scheduled SEP client scans from command prompt, batch scripts or the windows task scheduled with the SEP tool – DoScan. DoScan is not a separate scanner – it does use the same scan engine build-in in SEP – for it to run Autoprotect on the SEP client needs to be enabled.

DoScan.exe is located directly in the SEP installation folder:

  • C:\Program Files\Symantec\Symantec Endpoint Protection\Doscan.exe – 32bit OS
  • C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\Doscan.exe – 64bit OS

 

Important note: Using a direct call to the doscan.exe binary with a SYSTEM account may not work in SEP 12.1. For script usage it is recommended to call the doscan.exe from the following location:

C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\[SEPVersion]\Bin\doscan.exe (example: C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.2015.2015.105\Bin\doscan.exe) – for additional information please check http://www.symantec.com/docs/TECH199513

 

Here some examples in a historical overview over the options offered in Doscan.exe:

 

SEP 11 RU5 or earlier:

SEP 11 RU6 MP1 to RU7 MP3:

SEP 12.1 RTM – 12.1 RU2:

 

For the purpose of the article we will focus the latest version of DoScan.exe as it provides most features.

DoScan.exe [<Scan file/folder name>] [/F[ileList] "<List file name>"] [/Cloudscan or /O] [/ScanFile "<file name>"] [/ScanDir "<folder name>"] [/ScanName "<Configured Scan Name>"] [/L[ist]] [/C[mdLineScan] [/ScanAllDrives]] [/A[sync]|/Sync] [/Help]

 

Let’s look at those in details:

 

/L[ist] - Lists all the local and administrator scans configured for this computer.

/ScanName "<Configured Scan Name>" - Runs the specified local or administrator scan.

  • No additional scan options can be set – these will be taken over from the scheduled scan settings as configured in the policy
  • The name of the scan needs to be specified

 

/C[mdLineScan] -- Performs a quick scan.

   /ScanAllDrives -- Scans all disk drives.

 

/ScanDrive "<drives>" - Scans the specified drives with default scan options.

            For example: /ScanDrive "A-C,E,V-S,Z" scans drives A, B, C, E, S, T, U, V, Z.

 

/ScanFile "<file name>" - Scans the specified file with default scan options. Multiple files can be specified with multiple /ScanFile switches.

            For example: / ScanFile "%WinDir%\notepad.exe" /ScanFile "C:\Test"

 

/ScanDir "<folder name>" - Scans the specified folder with default scan options. Multiple folders can be specified

            with multiple /ScanDir switches.

            For example: /ScanDrive "%WinDir%\System32" /ScanDir "%Temp%" /ScanDir "C:\Test"

 

"<Scan file/folder name>" -- Specifies a single file/folder to scan.

            [/O] or [/Cloudscan] - Specifies that the item should also be sent

            to the Cloud for scanning.

            The switch will only apply to a single file item.

 

/F[ileList] "<List file name>" -- Specifies a text file that lists full paths

            of files/folders to scan.

            /O or /Cloudscan - Specifies that the item should also be sent

            to the Cloud for scanning.

            The switch will only apply if filelist contains a single file item.

 

/A[sync] -- Start scan asynchronously.

/Sync -- Start scan synchronously. (default)

/H[elp] -- Displays this help dialog.

 

Additional notes:

  • Old version on DoScan.exe from SEP 11 RU5 and below did have an addition switch for scan logs location specification:

/Logfile=”Log file path and filename”

- The file needs to be quoted

- The default log path is “C:\Documents and Settings\All Users\Application Data\Symantec\Symantec Endpoint Protection\Logs\Doscan.log” if not specific path and file name was specified

This switch has been removed from the 11 RU6 MP1 version onwards and now (as well in SEP 12.1) the logs default to the standard scan log location - same as for the scans from GUI (on example of SEP 12.1):

  1. + C:\ProgramData\Symantec\Symantec Endpoint Protection\12.1.2015.2015.105\Data\Logs\AV\[date_of_scan].log
  2. + C:\Documents and Settings\All Users\Application Data\Symantec \Symantec Endpoint Protection\12.1.2015.2015.105\Data\Logs\AV\[date_of_scan].log

 

  • The progress of the scan executed from command prompt will run in background and won’t be reflected in the SEP client GUI at all.
  • As doscan is not a separate scan engine- it cannot be started from a bootable disk alone and needs Autoprotect on the SEP client to be up and running.
  • While a system scan has been executed by doscan, starting another scan from client GUI won’t be possible and will error out with following information:

 

  • DoScan is designed as command prompt execution of SEP scans and an alternative to the scans started from GUI. For scanning large amount of data or network drives a different dedicated for this purpose Symantec Product is recommended that comes with very strong and enhanced command-line support – Symantec Scan Engine.

Statistics
0 Favorited
17 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Apr 25, 2019 02:09 AM

SYNC means, that the DoScan scan waits until every other scan which has already started is finished.
The ASYNC attribute gives you the chance to run multiple scan parallel and not queued. 
If you configure such a scenario you should avoid to have some overlaps and you need to consider that it could impact the system performance.

If you doesn't need it you don't need to add /sync as per default any doscan command runs withs this option.

https://www.symantec.com/docs/TECH104287

You can find the result of the scan within the SEP client => Virus and Spyware Protection logs or on Disk within %ProgramData%\Symantec\Symantec Endpoint Protection\CurrentVersion\Data\Logs\AV

It will be also visible within SEPM after the next Heartbeat or if it has a hit (finding) immediatly.

You can also use Host Integrity to run such a custom scan if needed from time to time.

 

Apr 23, 2019 12:03 PM

Does the /sync scan actually return the results of the scan itself - it seems that the command line accepts any switches and does not report invalid ones as an issue so I am wary

PS C:\Program Files (x86)\Symantec\Symantec Endpoint Protection> .\doscan.exe /scandir e:\vc\working\doesnotexist\at_all /sync /invalidswitch
PS C:\Program Files (x86)\Symantec\Symantec Endpoint Protection> echo $LASTEXITCODE
0
PS C:\Program Files (x86)\Symantec\Symantec Endpoint Protection>

What if a virus is found - how do I know? Specific return code?

What is in the the log files as it has little to do with the location in the /scandir option, just reports the number of files scanned.  I can see it has a logfile per day in csv format, but beyond that there is no way to connect a command line request to anything reported in the file. 

310317110000,3,2,1,TRACKER-PROD,tracker,,,,,,,16777216,"Scan started on selected drives and folders and all extensions.",1553768324,,0,,,,,0,,,,,,,,,,,{125930AE-67CC-4BA8-8EC7-B9E7F7C51F93},,,,ADREM,00:50:56:8B:39:FA,14.0.3752.1000,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,0,F4CA34C9D5D244C9BBF40BBB01361317,0,310317110000,,,3,Default,0,,,,0,,0
310317110000,2,2,1,TRACKER-PROD,tracker,,,,,,,16777216,"Scan Complete:  Risks: 0   Scanned: 0   Files/Folders/Drives Omitted: 0 Trusted Files Skipped: 0",1553768324,,0,0:0:0:0:0,,,,0,,,,,,,,,,,{125930AE-67CC-4BA8-8EC7-B9E7F7C51F93},,,,ADREM,00:50:56:8B:39:FA,14.0.3752.1000,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,0,F4CA34C9D5D244C9BBF40BBB01361317,0,310317110000,,,3,Default,0,,,,0,,0
 

Are you just supposed to copy the file as quickly as possible and assume the last lines are your own request. 

 

 

 

Sep 11, 2018 09:41 AM

Run Endpoint Protection scans from a command line using DoScan.exe

TECH104287 August 29th, 2017 https://www.symantec.com/docs/TECH104287

/A[sync]

Start scan asynchronously.

/Sync

Start scan synchronously. (default)

This means if the scan has to wait until another scan is finished or if the scan can start. 
The recommendation is to wait and it is also the default entry.

Sep 11, 2018 09:30 AM

Can anyone please explain the /Sync and /Async switches? Sync with what?

Sep 11, 2018 09:28 AM

Only way I am aware of is a reboot (Win 8.1)

Mar 16, 2018 08:01 AM

How do we stop a DoScan?

Oct 29, 2016 08:02 AM

CloudScan switch does not apply to SEP 14.0 version. 

Jan 31, 2013 06:08 AM

Very nice article, thanks for sharing.

Related Entries and Links

No Related Resource entered.