سؤال

I want to run a .bat file on my server via MSDeploy from remote. I installed the remote agent service on the server and started it. Also installed MSdeploy on my computer.

Now I want to execute the bat file from remote.

Can anyone help me out? Thanks, any help will be upvoted immediately!

هل كانت مفيدة؟

المحلول

You're looking for the runCommand provider:

msdeploy.exe -verb:sync ^
              -source:runCommand="path\to\batch.bat" ^
              -dest:auto,computerName=serverName,userName=user,password=pass

This will automatically transfer the batch file to the remote server as long as it is named .bat or .cmd and you do not pass any parameters to it.

نصائح أخرى

It sounds like you are trying to execute the bat file on one machine from another machine? If so have you considered PsExec from Sysinternals? http://technet.microsoft.com/en-us/sysinternals/bb897553

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top