@echo off
IF NOT EXIST "C:\Program Files\APPLICATION_DIR" ( msiexec /q /i "https://www.SOME-WEBSITE.com/software/APPLICATION_NAME_x64.msi" LICENSE_KEY="LICENSE_KEY_GOES_HERE" && echo APPLICATION_NAME script install on %computername% >> %~dp0\output.log ) ELSE ( echo APPLICATION_NAME was already installed on %computername% >> %~dp0\output.log )
@echo off
IF NOT EXIST "C:\Program Files\APPLICATION_DIR" ( msiexec /q /i "https://www.SOME-WEBSITE.com/software/APPLICATION_NAME_x64.msi" LICENSE_KEY="LICENSE_KEY_GOES_HERE" && echo APPLICATION_NAME script install on %computername% >> C:\temp\APPLICATION_NAME\output.log ) ELSE ( echo APPLICATION_NAME was already installed on %computername% >> C:\temp\APPLICATION_NAME\output.log )
I have configured a GPO that will run a computer startup script, to detect if a specific application is installed on a client machine and if not then to install the application. The msi file needs to be download from the URL when installing. I would like to create a log file preferably in a central location for example the SysVol where the batch file is located, if not then a log file on each machine would be fine for example C:\temp\APPLICATION_NAME\log.txt.
I have manually ran the batch file and it works. Once you launch the batch file it will check if the path to the APPLICATION_DIR does NOT exists then install the APPLICATION_NAME and create log file, if the path DOES exist then only create the log file and exit.
I have a few machines in the OU that I have linked this GPO to and it does not seem to be working. I am looking for the log file to either exist on the client or the SysVol. I have modified the batch file to either create the log file in the same directory that it runs from or the second option to create it on the client.