Psexec - a script to use Psexec to copy a folder from one server to multiple PC's?
Posted on 2016-09-08
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:
>"%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!"
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