1
I'm trying to write a batch file that will robocopy
a msi file from a server to all the domain PCs that are online at that time.
It should skip PCs that already have the file listed and PCs that are offline.
Currently I'm using this.
for /f %%i in (\\domain.lan\folder\folder\computers.txt) do robocopy c:\software\msifolder \\%%i\c$\install /MIR
After that I'm using psexec
to open a CMD on the target PC and run the MSI with msiexec
psexec \\computername.domain.lan -u domain\"Username" -p "Password" cmd >> \domain.lan\folder\folder\software.install.txt 2>&1
msiexec.exe /quiet /i c:\install\software.msi /norestart
The idea is to let this script run as a task for a week to install a program on as many PCs as possible unattended.
The psexec
and msiexec
are working fine. But the robocopy
keeps retrying to access PCs that are offline. It should just skip to the next computer.
I tried to include as much info as possible. Let me know if you need more info.
1Try and ping em, if no response, don't do the robocopy – djsmiley2k TMW – 2017-06-01T16:30:30.230