0
@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.

127001
  • 1
  • 1
  • That may be an indication sysvol is not available when policies are processed. Workstations by default do not wait for the network at startup. That would be the first thing to check and test. Also if this is a small script, it may be more robust if it is copied as a file policy preference, then the script could be executed locally. – Greg Askew Aug 18 '21 at 20:14
  • Thank you for your response @GregAskew. I actually tried the file copy suggest but used a PowerShell script instead of a batch file. I will go ahead and attempt the file copy again but instead this time use the batch file. – 127001 Aug 23 '21 at 15:44

0 Answers0