0
继执行时抛出的错误是我的msdeploy
命令从一个服务器复制到另一个文件(到server2
)成功:msdeploy命令从.bat文件
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文件中正常工作。
你打算使用单引号“C:\构建\ DIST”? – RGuggisberg
不,双引号是我所知道的正确方式 – Srini
'CD C:\ Program Files \ IIS \ Microsoft Web Deploy V3'需要围绕目录名称,因为它包含空格。 – DavidPostill