0

Following is my msdeploy command to copy files from one server to another (server1 to server2) successfully:

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

I have one more similar command exactly as above to transfer files between server3 and server4 as well which is working successfully from command prompt. Whereas when i put one of these commands or both in a .bat file, getting the following error:

enter image description here

Below is the exact content of my batch file:

@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

I tried running as an administrator , still the same problem. To my surprise the exact same commands with some other servers are working fine from the .bat file as well.

hakuna
  • 6,243
  • 10
  • 52
  • 77

1 Answers1

0

Executing the batch file with cmd /c is working. Usually cmd /c needs to be used to return control to the bat file even though there are fatal errors. Don't know the exact reason why only this works because there are no fatal errors in my case.

check this for more information A .bat File, "Call" or Not to "Call", That is the

Community
  • 1
  • 1
hakuna
  • 6,243
  • 10
  • 52
  • 77