码迷,mamicode.com
首页 > 其他好文 > 详细

通过psexec实现远程安装软件包

时间:2018-09-17 12:30:53      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:int   from   level   .exe   tail   erro   failed   microsoft   share   

1.在管理机上下载和安装psexec

https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

2.在管理机上编写bat脚本,存放在管理机的(c:\inssm.bat); 客户端通过该脚本来安装软件包

@echo off
net use x:  \\10.97.xx.241\Share /user:username pwd
x:

REM “Replace your codes starts from here”
Ec2Install.exe /sp- /silent /norestart
REM “replace your codes end of here.”
if %ERRORLEVEL% NEQ 0 goto failed
echo "SSM agent updated DONE!"

cd ..
echo %computername% %date% %time% >> ComputerList.txt
echo "Updating of SSM agent succeeded. "
goto end

:faile
echo $%computername% %date% %time% >> ComputerList.txt
echo "Updating of SSM agent failed. "

:end
c:
net use x: /delete

3. 在管理机上通过psexec把bat脚本copy到远端机器,并且通过脚本实现软件包的安装

PS C:\PSTools> .\PsExec.exe \\10.xx.xx.81 -u admin -p "password" -c -w c:/ "C:\inssm.bat"

 

Refer:

https://blog.csdn.net/cneducation/article/details/3997166

https://blog.csdn.net/Miss_Easy/article/details/47780797

  

  

通过psexec实现远程安装软件包

标签:int   from   level   .exe   tail   erro   failed   microsoft   share   

原文地址:https://www.cnblogs.com/oskb/p/9661364.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!