Hi guys,
I've got a script here that OdBA created for me a while back which was to execute a .msi file from a shared location on our server to multiple PC's using the Psexec command.
Here it is:
@echo off
setlocal enabledelayedexpansion
set MachineFile=C:\Temp\machines.txt
set LogFile=C:\Temp\machines.csv
>"%LogFile%" echo "Machine","State","Errorlevel"
for /f %%a in ('type "%MachineFile%"') do (
echo Processing %%a ...
ping.exe -4 -n 2 %%~a | find /i "TTL" >NUL
if errorlevel 1 (
>>"%LogFile%" echo "%%~a","Offline","n/a"
) else (
ECHO c:\psexec.exe \\%%~a -u Domain\Username -p Password msiexec.exe /i "\\networkservername\sharename\my.msi" /quiet /norestart
>>"%LogFile%" echo "%%~a","Online","!ErrorLevel!"
)
)
echo Done.
Is there a way to modify this so that it can copy a folder from the server share, to a folder on PC's with different IP's?
Thanks a lot
Yashy
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.