Command Line

Expand all | Collapse all

Batch file to automatically download latest Intelligent Updater definitions

  • 1.  Batch file to automatically download latest Intelligent Updater definitions

    Posted 01-28-2020 09:11 AM

    Hi everyone,

    I had a batch file script which I found at

    https://www.symantec.com/connect/downloads/script-download-intelligent-updater-ftpsymanteccom?cid=11849561#comment-11849561

    On running the batch file, it would find the latest Intelligent Updater definition file and download it. This was brilliant as I was able to get it to run on startup and it gave me and my parents one less thing to do.

    Just recently, the script has stopped working. Below is the script as it is on my PC:

    @echo off
    
    set dir="C:\Symantec Updates"
    
    mkdir %dir%
    
    forfiles /P %dir% /S /M *.exe /D -3 /C "cmd /c del @path"
    
    cd %dir%
    
    
    echo Start > log32.txt
    date /T >> log32.txt
    time /T >> log32.txt
    if exist _.ftp32 del _.ftp32
    >_.ftp32 echo open ftp.symantec.com
    >>_.ftp32 echo anonymous
    >>_.ftp32 echo anonymous
    >>_.ftp32 echo cd AVDEFS/symantec_antivirus_corp/
    >>_.ftp32 echo bin
    >>_.ftp32 echo prompt
    >>_.ftp32 echo dir *-core3sdsv5i64.exe
    >>_.ftp32 echo bye
    
    
    for /f "tokens=9" %%i in (
    'ftp -s:_.ftp32'
    ) do (
    set file=%%i
    )
    
    
    >_.ftp32 echo open definitions.symantec.com/defs/
    >>_.ftp32 echo anonymous
    >>_.ftp32 echo anonymous
    >>_.ftp32 echo cd AVDEFS/symantec_antivirus_corp/
    >>_.ftp32 echo bin
    >>_.ftp32 echo prompt
    >>_.ftp32 echo mget %file%
    >>_.ftp32 echo bye
    echo File %file% >> log32.txt
    ftp -s:_.ftp32
    del _.ftp32 >nul
    @echo. >> log32.txt
    echo End >> log32.txt
    date /T >> log32.txt
    time /T >> log32.txt
    
    start %file%
    
    forfiles /P %dir% /S /M *.exe /D -1 /C "cmd /c del @path"
    
    del %dir%\%file%
    
    exit

    1) Can anyone help as to why it has stopped working?

    2) If anyone can get it to work, that would be brilliant!

    3) If it can be made to work, is it possible to then automtically run the definition update?

     

    Thank you people of the internet!



  • 2.  RE: Batch file to automatically download latest Intelligent Updater definitions

    Posted 03-05-2020 04:31 PM
    Hi,

    Believe their FTP site is no longer alive so the script you referenced shouldn't work.

    Through trial and error, I made my own set of Windows 7 batch scripts to automate updates using Task Scheduler because I turned off N360 v21 LiveUpdates. It utilizes WGET which I downloaded and pasted in c:\Windows\System32.

    Each script (saved as .bat file) does the following:
    • Determine the appropriate date in YYYYMMDD format to use in the URL
    • Check multiple file names for the N360 v21 64bit Intelligent Updater you need (change the script if you need a different version or find the version number ranges differ over time).
      • In the early AM, you will see file names using 001-005.
      • In the late afternoon, you will see file names containing 006-016.
      • After midnight, there is a 3rd update which contains 017-037 and the file name date is the previous date so that's why the script differs from the others.
    • Download the appropriate file and skip the others without affecting the downloaded file.
    • Change directories to your downloads folder. If you save the file to a different location, remember to change the:
      • WGET script lines which tell WGET where to save the exe.
      • Commands to navigate to the downloads folder.
    • Run the downloaded file "quietly" so there are no user prompts (need to run the script with admin rights to ensure no user intervention is needed).
    • Delete the downloaded file so your drive doesn't fill up with Norton files.

    At 8:15 am EST, I run the following task with highest privileges: 
    set YYYYMMDD=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-001-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-002-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-003-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-004-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-005-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    d:
    cd downloads
    %YYYYMMDD%-v5i64 /q
    del /f %YYYYMMDD%-v5i64.exe​


    At 6:15 pm EST, I run the following task with highest privileges: 

    set YYYYMMDD=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-006-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-007-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-008-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-009-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-010-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-011-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-012-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-013-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-014-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-015-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%YYYYMMDD%-016-v5i64.exe" -O "D:\Downloads\%YYYYMMDD%-v5i64.exe"
    d:
    cd downloads
    %YYYYMMDD%-v5i64 /q
    del /f %YYYYMMDD%-v5i64.exe

    At 2:30 am EST, I run the following task with highest privileges: 
    setlocal EnableDelayedExpansion
    
    set /A "YYYY=%DATE:~10,4%, MM=1%DATE:~4,2%-100, DD=1%DATE:~7,2%-101, Feb=28+^!(YYYY%%4)"
    
    set "DPM= 31 31 %Feb% 31 30 31 30 31 31 30 31 30"
    if %DD% equ 0 set /A "MM+=M=-1,DD=0%DPM: =+^!(MM-(M+=1))*%,YYYY-=^!MM,MM+=12*^!MM"
    set /A "MM+=100,DD+=100"
    
    set "a=%YYYY%%MM:~1%%DD:~1%"
    
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-017-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-018-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-019-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-020-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-021-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-022-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-023-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-024-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-025-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-026-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-027-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-028-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-029-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-030-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-031-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-032-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-033-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-034-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-035-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-036-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    start /b /wait wget -q -c "http://definitions.symantec.com/defs/%a%-037-v5i64.exe" -O "D:\Downloads\%a%-v5i64.exe"
    d:
    cd downloads
    %a%-v5i64 /q
    del /f %a%-v5i64.exe​


    I have no real coding experience but did my best attempt, so feel free to modify the timing and scripts as you see fit.

    Hope this helps!

    Best,
    Andrew




  • 3.  RE: Batch file to automatically download latest Intelligent Updater definitions

    Posted 05-01-2020 07:25 AM
    Hi Andrew.

    Sorry for the delay in replying. I didnt receive notification that there had been a reply.

    I managed to install Wget then run your code, but nothing appears to happen and with zero experience of coding, I don't know what is the next best step to take.

    Thanks.

    Phil


  • 4.  RE: Batch file to automatically download latest Intelligent Updater definitions

    Posted 08-24-2020 06:43 PM
    Edited by Andrew L 08-24-2020 09:18 PM
    Hey Phil,
    Sorry for the delay as I lost access to that email account and didn't get any notifications myself.

    Created a new account so if you sent me any PMs to the other account, I didn't receive them.

    Not sure where you're having trouble exactly. You said you installed wget in the System32 folder, so are you running the morning script in the morning, saving it as a .bat file, and launching? Or are you attempting to do the Task Scheduler part at the same time? Would advise not doing the Task Scheduler piece until you've gotten the scripts working first.

    If you run the script (and not silently through Task Scheduler), a command prompt window should appear and attempt to connect to the URLs in the script as pictured here.

    In the above case, it found the right file at the first URL and is pausing to actually download the file (silently) to the download location specified in the script -- in my case I have a D drive with a downloads folder so it is being loaded there.

    Then it runs through the rest of the URLs and won't find anything, so it attempts to run the downloaded file in the download location (your download location might differ so you have to modify the script some so it navigates to the right folder).

    Then it runs the downloaded definitions file silently so you won't see anything except if you open Task Manager and notice that file is running.

    Once done with the update, the script deletes the Symantec file and it's done.

    Hope this helps!

    Stay well,
    Andrew