Follow

Install Avast using a .bat as a logon script

Install Avast using a .bat as a logon script

 

1) Copy the text below and save as a .bat file.

2) Change the file location to reflect the location and name of the install file on your network. (\\server\install\avast_business_antivirus_setup.exe) 

3) If you are not familiar with how to use a logon script with your domain, search the Microsoft web site for your domain controllers OS and how to use logon scripts.

https://technet.microsoft.com/en-us/library/Cc753404.aspx

 

 

The script below checks for the file bccinfo.dat and if it exist will abort the installation to prevent a reinstall each time the device logs on the network.

 

 

IF EXIST "c:\programdata\Avast Software\avast\bccinfo.dat" GOTO END

 

:32-bit

if exist %SystemRoot%\SysWOW64 goto 64-bit

\\server\install\avast_business_antivirus_setup.exe

echo "Avast Business Install" >

goto END

 

:64-bit

\\server\install\avast_business_antivirus_setup.exe

echo "Avast Business Install" >

:END

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Олег Гурьев

    Unfoturnatly this method doesn't work in my configuration.
    If user is not admin - installation won't run.
    I've got different solution, using VBS:
    ----------Code Start--------
    On Error resume next
    set WSHShell = CreateObject("WScript.Shell")
    set objNetwork = CreateObject("wscript.network")
    set objSysInfo = CreateObject("ADSystemInfo")

    'Preferences
    DISTRD = "\srv-001\software$\" 'Path to Installer
    DISTR = "avast_business_antivirus_setup.exe" 'Installer's name
    REGCHK = "HKLM\SOFTWARE\ScriptInstall\Avast" 'Reg key to check previous install

    strCHK = WSHShell.regRead(REGCHK)

    If trim(StrCHK) = "" Then
    WSHShell.RegWrite REGCHK, "Installed", "REG_SZ"
    else
    WSH.QUIT
    end if

    RUNSTR = CHR(34) & DISTRD & DISTR & CHR(34)
    WSHSHEll.Run RUNSTR,0,TRUE
    ------Code end----------
    I use this script in GPO. Section Computer Configuration/Windows Settings/Scripts/Startup

    Maybe it will be useful for someone.

  • 0
    Avatar
    Jose Avila

    It doesn't matter if the user is admin or not because the script will run before log on. That's why you must put the script in Computer startup scripts and not User log on scripts.

Please sign in to leave a comment.
Powered by Zendesk