msdeploy
将文件从一台服务器复制到另一台服务器的命令(
server1
到
server2
MSDeploy.exe -source:contentPath="C:\inetpub\wwwroot\dist",computerName="https://server1:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXX",authtype="Basic" -allowUntrusted -dest:contentPath='C:\Builds\dist',computerName="https://server2:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXXX",authtype="Basic",includeAcls="False" -verb:sync -allowUntrusted
我还有一个与上面完全相同的命令,用于在
server3
和
server4
以及从命令提示符成功工作。而当我在
.bat
文件,得到以下错误:
下面是我的批处理文件的确切内容:
@ECHO OFF
CD C:\Program Files\IIS\Microsoft Web Deploy V3
MSDeploy.exe -source:contentPath="C:\inetpub\wwwroot\dist",computerName="https://server1:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXX",authtype="Basic" -allowUntrusted -dest:contentPath='C:\Builds\dist',computerName="https://server2:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXXX",authtype="Basic",includeAcls="False" -verb:sync -allowUntrusted
MSDeploy.exe -source:contentPath="C:\inetpub\wwwroot\dist",computerName="https://server3:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXX",authtype="Basic" -allowUntrusted -dest:contentPath='C:\Builds\dist',computerName="https://server4:8172/MSDeploy.axd",username="administrator",password="XXXXXXXXXX",authtype="Basic",includeAcls="False" -verb:sync -allowUntrusted
我试着以管理员身份运行,但仍然存在相同的问题。令我惊讶的是,在.bat文件中,与其他服务器完全相同的命令也可以正常工作。