I\'ve got an ASP.NET web app that I publish to our website when I make changes or fix bugs. We want to automatically save a backup of the project files to our server (separ
When you run the cmd file manually, the script surely runs with administrator privileges, or enough privileges to succesfully copy the files to the destination (in the I: unit in this case).
The thread that executes the script from Visual Studio probably has very restricted privileges, due to security reasons.
Your best bet, is run the script from powershell, passing the following argument to it:
-ExecutionPolicy Unrestricted
Your XML
will look like this:
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe
C:\deg\bat\backupRMA.cmd
You can also check this MSDN link for similar commands:
http://www.asp.net/web-forms/tutorials/deployment/advanced-enterprise-web-deployment/running-windows-powershell-scripts-from-msbuild-project-files