Originally Posted by: dgparryuk 
oakleyross - genius - there are a few minor bugs in it...
if anyone else is having trouble with it
all the "%logshare%%ComputerName%.log" lines need a \ - ie "%logshare%\%ComputerName%.log"
REM IF EXIST "%SYSTEMDRIVE%\Program Files (x86)\ScreenConnect Client*" set CustomConfig=exists
REM IF EXIST "%SYSTEMDRIVE%\Program Files\ScreenConnect Client*" set CustomConfig=exists
shouldn't be REM'd out
other than that :-)
I ran into issues using this script this week. I had used it before, and made changes to get it to work, but had forgotten the changes I had to make.
I am re-posting the script, in it's entirety, with changes I had to make to get it to run. Modify as required:
REM *** CUT AND PASTE THIS INTO A BAT OR CMD FILE TO RUN ***
REM *** ONLY AFTER YOU EDIT THE 4 VARIABLES BELOW ***
REM *** ***
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *** ***
REM *** DATE: October 3rd, 2018 ***
REM *** ***
REM *** DESCRIPTION: ***
REM *** Check and Deploy Screen Connect Client ***
REM *** Via Active Directory Startup Script ***
REM *** ***
REM *** INPUTS: ***
REM *** (1) Package Location/Deployment Directory ***
REM *** (2) Script Logging Directory ***
REM *** (3) Package Installer Command Line Options ***
REM *** (4) Package Installer File Name ***
REM *** ***
REM *** OUTPUTS: Installs the Screen Connect Client ***
REM *** Reports an error if the client ***
REM *** is already installed ***
REM *** ***
REM *** ***
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
setlocal
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *** ***
REM *** INPUTS (MODIFY AS APPROPRIATE) ***
REM *** ***
REM *** ***
REM *** (1) Package Location/Deployment Directory ***
REM *** (2) Script Logging Directory ***
REM *** (3) Package Installer Command Line Options ***
REM *** (4) PACKAGE INSTALLER File Name ***
REM *** ***
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *** (1) PACKAGE LOCATION/DEPLOYMENT DIRECTORY ***
REM *** ***
set DeployDirectory=\\<server FQDN>\ScreenConnectREM *** ***
REM *** (2) SCRIPT LOGGING DIRECTORY ***
REM *** ***
set logshare=\\<server FQDN>\ScreenConnect\ScreenConnectLogsREM *** ***
REM *** (3) PACKAGE INSTALLER COMMAND LINE OPTIONS ***
REM *** ***
set CommandLineOptions=/quiet
REM Had to change from silent to quietREM *** ***
REM *** (4) PACKAGE INSTALLER FILE NAME ***
REM *** ***
set InstallFile=<.MSI file name>REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *** ***
REM *** ***
REM *** BEGIN SCRIPT PROCESSING ***
REM *** ***
REM *** ***
REM *************************************************************
REM *************************************************************
REM *************************************************************
REM *************************************************************
echo %date% %time% the %0 script is running >> %logshare%\%ComputerName%.log
REM *************************************************************
REM System verification
REM *************************************************************
set CustomConfig=None
REM Check if the screen connect client is already installed
IF EXIST "%SYSTEMDRIVE%\Program Files (x86)\ScreenConnect Client (<already installed #>)" set CustomConfig=exists
IF EXIST "%SYSTEMDRIVE%\Program Files\ScreenConnect Client (<already installed #>)" set CustomConfig=existsREM
if %CustomConfig%==exists goto Found
REM *************************************************************
REM Deployment begins here
REM *************************************************************
:NotFound
REM
echo %date% %time% Package not detected, Begin Deployment >> %logshare%\%ComputerName%.log
start /wait %DeployDirectory%\%InstallFile% %CommandLineOptions%
REM
echo %date% %time% Deployment Completed >> %logshare%\%ComputerName%.log
echo %date% %time% : >> %logshare%\%ComputerName%.log
echo %date% %time% Install Logs: >> %logshare%\%ComputerName%.log
echo %date% %time% : >> %logshare%\%ComputerName%.log
goto End
:Found
echo %date% %time% Screen Client install was detected, Halting >> %logshare%\%ComputerName%.log
goto End
:End
echo %date% %time% the %0 script has completed successfully >> %logshare%\%ComputerName%.log
Endlocal